X-Git-Url: https://git.distorted.org.uk/u/mdw/putty/blobdiff_plain/193c8d4a7559f40fe0e0c8610cf6832a0e976e77..32f8db2c94c447f20eaa7cc056e2109d5c25ef68:/unix/uxpty.c diff --git a/unix/uxpty.c b/unix/uxpty.c index 99c1221a..186ff5a9 100644 --- a/unix/uxpty.c +++ b/unix/uxpty.c @@ -342,12 +342,21 @@ static void pty_open_master(Pty pty) #endif ; +#ifdef HAVE_POSIX_OPENPT + pty->master_fd = posix_openpt(flags); + + if (pty->master_fd < 0) { + perror("posix_openpt"); + exit(1); + } +#else pty->master_fd = open("/dev/ptmx", flags); if (pty->master_fd < 0) { perror("/dev/ptmx: open"); exit(1); } +#endif if (grantpt(pty->master_fd) < 0) { perror("grantpt");