about summary refs log tree commit diff
path: root/Src/Modules
diff options
context:
space:
mode:
authorOliver Kiddle <opk@zsh.org>2014-11-24 00:05:59 +0100
committerOliver Kiddle <opk@zsh.org>2014-11-24 00:05:59 +0100
commita526a2203b26cb6b9d3546b92761f3b2217805ef (patch)
tree2faf080e7c1715fbe8fce70b8536064539702fdd /Src/Modules
parent9161a16b2e2c770c7d518a394208476cf6c418fd (diff)
downloadzsh-a526a2203b26cb6b9d3546b92761f3b2217805ef.tar.gz
zsh-a526a2203b26cb6b9d3546b92761f3b2217805ef.tar.xz
zsh-a526a2203b26cb6b9d3546b92761f3b2217805ef.zip
33743: use posix_openpt in zpty if it is available
Diffstat (limited to 'Src/Modules')
-rw-r--r--Src/Modules/zpty.c4
1 files changed, 4 insertions, 0 deletions
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))) {