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 --- Src/Modules/zpty.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'Src/Modules') 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))) { -- cgit 1.4.1