X-Git-Url: https://git.distorted.org.uk/u/mdw/putty/blobdiff_plain/1d2a5e0b5bf87a0a0c8a02a3f06b7c9a1f426d9f..193c8d4a7559f40fe0e0c8610cf6832a0e976e77:/unix/uxpty.c diff --git a/unix/uxpty.c b/unix/uxpty.c index 36a05fcc..99c1221a 100644 --- a/unix/uxpty.c +++ b/unix/uxpty.c @@ -335,7 +335,14 @@ static void pty_open_master(Pty pty) chown(pty->name, getuid(), gp ? gp->gr_gid : -1); chmod(pty->name, 0600); #else - pty->master_fd = open("/dev/ptmx", O_RDWR); + + const int flags = O_RDWR +#ifdef O_NOCTTY + | O_NOCTTY +#endif + ; + + pty->master_fd = open("/dev/ptmx", flags); if (pty->master_fd < 0) { perror("/dev/ptmx: open");