From a526a2203b26cb6b9d3546b92761f3b2217805ef Mon Sep 17 00:00:00 2001 From: Oliver Kiddle Date: Mon, 24 Nov 2014 00:05:59 +0100 Subject: 33743: use posix_openpt in zpty if it is available --- ChangeLog | 5 +++++ Src/Modules/zpty.c | 4 ++++ configure.ac | 1 + 3 files changed, 10 insertions(+) diff --git a/ChangeLog b/ChangeLog index 6f8438db2..a11982965 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2014-11-23 Oliver Kiddle + + * 33743: Src/Modules/zpty.c, configure.ac: use posix_openpt + if it is available + 2014-11-23 Peter Stephenson * 33729: Completion/Unix/Command/_git: "git remote add" should diff --git a/Src/Modules/zpty.c b/Src/Modules/zpty.c index d119658c3..63c79a731 100644 --- a/Src/Modules/zpty.c +++ b/Src/Modules/zpty.c @@ -189,7 +189,11 @@ get_pty(int master, int *retfd) #endif if (master) { +#ifdef HAVE_POSIX_OPENPT + if ((mfd = posix_openpt(O_RDWR|O_NOCTTY)) < 0) +#else if ((mfd = open("/dev/ptmx", O_RDWR|O_NOCTTY)) < 0) +#endif return 1; if (grantpt(mfd) || unlockpt(mfd) || !(name = ptsname(mfd))) { diff --git a/configure.ac b/configure.ac index 306a0057d..56c4cfb13 100644 --- a/configure.ac +++ b/configure.ac @@ -1291,6 +1291,7 @@ AC_CHECK_FUNCS(strftime strptime mktime timelocal \ pcre_compile pcre_study pcre_exec \ nl_langinfo \ erand48 open_memstream \ + posix_openpt \ wctomb iconv \ grantpt unlockpt ptsname \ htons ntohs \ -- cgit 1.4.1