[gvfs] pty_open: Fix warnings with BSD codepath



commit 65ebb59e40f60e6a76421e98621efee56ee385da
Author: Ross Lagerwall <rosslagerwall gmail com>
Date:   Sun Jun 29 15:11:53 2014 +0100

    pty_open: Fix warnings with BSD codepath
    
    Fix warnings by conditionally compiling functions needed for the
    UNIX98_PTY codepath.  Also, make a function static.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=724780

 daemon/pty_open.c |    9 ++++-----
 1 files changed, 4 insertions(+), 5 deletions(-)
---
diff --git a/daemon/pty_open.c b/daemon/pty_open.c
index fecd0d1..e0402d8 100644
--- a/daemon/pty_open.c
+++ b/daemon/pty_open.c
@@ -86,8 +86,6 @@
 #undef HAVE_UNIX98_PTY
 #endif
 
-int _pty_set_size(int master, int columns, int rows);
-
 /* Solaris does not have the login_tty() function so implement locally. */
 #ifndef HAVE_LOGIN_TTY
 static int login_tty(int pts)
@@ -189,6 +187,7 @@ _pty_reset_signal_handlers(void)
 #endif
 }
 
+#ifdef HAVE_UNIX98_PTY
 #ifdef HAVE_SOCKETPAIR
 static int
 _pty_pipe_open(int *a, int *b)
@@ -407,6 +406,8 @@ _pty_run_on_pty(int fd, gboolean login,
        return 0;
 }
 
+static int _pty_set_size(int master, int columns, int rows);
+
 /* Open the named PTY slave, fork off a child (storing its PID in child),
  * and exec the named command in its own session as a process group leader */
 static int
@@ -643,7 +644,7 @@ _pty_fork_on_pty_name(const char *path, int parent_fd, char **env_add,
  *
  * Returns: 0 on success, -1 on failure.
  */
-int
+static int
 _pty_set_size(int master, int columns, int rows)
 {
        struct winsize size;
@@ -738,8 +739,6 @@ _pty_unlockpt(int fd)
 #endif
 }
 
-#if defined(HAVE_UNIX98_PTY)
-
 static int
 _pty_open_unix98(pid_t *child, guint flags, char **env_add,
                           const char *command, char **argv,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]