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



commit 28eb1caaf6cea748ed824f47717f19c6e532d5ec
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 53f0c6e..b1c59cb 100644
--- a/configure.in
+++ b/configure.in
@@ -227,7 +227,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 cfd7cd0..83c6dc0 100644
--- a/src/pty.c
+++ b/src/pty.c
@@ -712,7 +712,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]