From: Wez Furlong Date: Sat, 29 May 2004 00:30:11 +0000 (+0000) Subject: Don't rely on TIOCNOTTY. X-Git-Tag: php-5.0.0RC3RC2~71 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7171429f21000d7b10cbc1fb06655f4ed6332aa2;p=php Don't rely on TIOCNOTTY. --- diff --git a/ext/standard/proc_open.c b/ext/standard/proc_open.c index acf417163a..ddc34a2c2f 100644 --- a/ext/standard/proc_open.c +++ b/ext/standard/proc_open.c @@ -59,9 +59,7 @@ #if HAVE_PTSNAME && HAVE_GRANTPT && HAVE_UNLOCKPT && HAVE_SYS_IOCTL_H && HAVE_TERMIOS_H # include # include -# 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);