[vte/vte-0-34] pty: Use posix_openpt() if available



commit 4ed69e422a4a203b9c9bb3f4d594daa6d41f8c37
Author: Brad Smith <brad comstyle com>
Date:   Sat Feb 23 22:49:00 2013 +0100

    pty: Use posix_openpt() if available
    
    https://bugzilla.gnome.org/show_bug.cgi?id=694494

 configure.in |    2 +-
 src/pty.c    |    4 +++-
 2 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/configure.in b/configure.in
index 4d9412a..eb39147 100644
--- a/configure.in
+++ b/configure.in
@@ -219,7 +219,7 @@ AC_CHECK_HEADERS(sys/select.h sys/syslimits.h sys/termios.h sys/un.h sys/wait.h
 AC_HEADER_TIOCGWINSZ
 
 # Check for PTY handling functions.
-AC_CHECK_FUNCS([cfmakeraw fork setsid setpgid getpgid getpt grantpt unlockpt ptsname ptsname_r tcgetattr 
tcsetattr])
+AC_CHECK_FUNCS([cfmakeraw fork setsid setpgid getpgid getpt grantpt unlockpt posix_openpt ptsname ptsname_r 
tcgetattr tcsetattr])
 
 # Pull in the right libraries for various functions which might not be
 # bundled into an exploded libc.
diff --git a/src/pty.c b/src/pty.c
index be4b48a..c16bf31 100644
--- a/src/pty.c
+++ b/src/pty.c
@@ -837,7 +837,9 @@ static int
 _vte_pty_getpt(GError **error)
 {
        int fd, flags, rv;
-#ifdef HAVE_GETPT
+#if defined(HAVE_POSIX_OPENPT)
+       fd = posix_openpt(O_RDWR | O_NOCTTY);
+#elif defined(HAVE_GETPT)
        /* Call the system's function for allocating a pty. */
        fd = getpt();
 #else


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