]> granicus.if.org Git - php/commitdiff
Don't rely on TIOCNOTTY.
authorWez Furlong <wez@php.net>
Sat, 29 May 2004 00:30:11 +0000 (00:30 +0000)
committerWez Furlong <wez@php.net>
Sat, 29 May 2004 00:30:11 +0000 (00:30 +0000)
ext/standard/proc_open.c

index acf417163a2ce3987ae32e76caeca40e3056498f..ddc34a2c2f6d8f780af7b0ff7ee402bfa35ebf28 100644 (file)
@@ -59,9 +59,7 @@
 #if HAVE_PTSNAME && HAVE_GRANTPT && HAVE_UNLOCKPT && HAVE_SYS_IOCTL_H && HAVE_TERMIOS_H
 # include <sys/ioctl.h>
 # include <termios.h>
-# ifdef TIOCNOTTY
-#  define PHP_CAN_DO_PTS       1
-# endif
+# define PHP_CAN_DO_PTS        1
 #endif
 
 #include "proc_open.h"
@@ -754,8 +752,12 @@ PHP_FUNCTION(proc_open)
                if (dev_ptmx >= 0) {
                        int my_pid = getpid();
 
+#ifdef TIOCNOTTY
                        /* detach from original tty. Might only need this if isatty(0) is true */
                        ioctl(0,TIOCNOTTY,NULL);
+#else
+                       setsid();
+#endif
                        /* become process group leader */
                        setpgid(my_pid, my_pid);
                        tcsetpgrp(0, my_pid);