From 7171429f21000d7b10cbc1fb06655f4ed6332aa2 Mon Sep 17 00:00:00 2001 From: Wez Furlong Date: Sat, 29 May 2004 00:30:11 +0000 Subject: [PATCH] Don't rely on TIOCNOTTY. --- ext/standard/proc_open.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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); -- 2.40.0