From: Juho S. <js...@us...> - 2009-10-03 23:03:13
|
Update of /cvsroot/sbcl/sbcl/src/runtime In directory fdv4jf1.ch3.sourceforge.com:/tmp/cvs-serv14876/src/runtime Modified Files: run-program.c Log Message: 1.0.31.27: RUN-PROGRAM process group change * Have RUN-PROGRAM with :INPUT T only run the subprocess in a new process group if it doesn't need to share stdin with the sbcl process. (patch by Leslie Polzer) Index: run-program.c =================================================================== RCS file: /cvsroot/sbcl/sbcl/src/runtime/run-program.c,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- run-program.c 3 Jan 2009 16:02:31 -0000 1.18 +++ run-program.c 3 Oct 2009 22:36:59 -0000 1.19 @@ -65,16 +65,22 @@ if (pid != 0) return pid; - /* Put us in our own process group. */ + /* Put us in our own process group, but only if we need not + * share stdin with our parent. In the latter case we claim + * control of the terminal. */ + if (sin >= 0) { #if defined(LISP_FEATURE_HPUX) - setsid(); + setsid(); #elif defined(LISP_FEATURE_DARWIN) - setpgid(0, getpid()); + setpgid(0, getpid()); #elif defined(SVR4) || defined(__linux__) || defined(__osf__) - setpgrp(); + setpgrp(); #else - setpgrp(0, getpid()); + setpgrp(0, getpid()); #endif + } else { + tcsetpgrp(0, getpgrp()); + } /* unblock signals */ sigemptyset(&sset); |