# adapted from http://svnweb.freebsd.org/ports/head/x11-toolkits/vte/ --- config.h.in.orig Wed May 17 10:45:57 2006 +++ config.h.in Wed May 17 10:46:25 2006 @@ -106,6 +106,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_GL_GLX_H +/* Define to 1 if you have the `posix_openpt' function. */ +#undef HAVE_POSIX_OPENPT + /* Define to 1 if you have the `grantpt' function. */ #undef HAVE_GRANTPT --- configure.orig 2010-03-30 14:43:41.000000000 +0200 +++ configure 2010-03-30 14:47:26.000000000 +0200 @@ -14102,7 +14102,7 @@ # Check for PTY handling functions. -for ac_func in cfmakeraw fork setsid setpgid getpgid getpt grantpt unlockpt ptsname ptsname_r tcgetattr tcsetattr +for ac_func in cfmakeraw fork setsid setpgid getpgid getpt grantpt posix_openpt unlockpt ptsname ptsname_r tcgetattr tcsetattr do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" --- src/pty.c.orig 2012-07-20 13:47:16.000000000 +0200 +++ src/pty.c 2012-07-20 14:07:30.000000000 +0200 @@ -837,7 +837,11 @@ _vte_pty_getpt(GError **error) { int fd, flags, rv; -#ifdef HAVE_GETPT + +#ifdef HAVE_POSIX_OPENPT + /* Call the system's function for allocating a pty. */ + fd = posix_openpt(O_RDWR | O_NOCTTY); +#elif defined(HAVE_GETPT) /* Call the system's function for allocating a pty. */ fd = getpt(); #else @@ -829,6 +833,9 @@ return -1; } +#if defined(__APPLE__) && defined(__MACH__) + /* fcntl(F_SETFL) failed */ +#else rv = fcntl(fd, F_GETFL, 0); if (rv < 0) { int errsv = errno; @@ -853,6 +860,7 @@ errno = errsv; return -1; } +#endif return fd; }