diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 5745b0d23..d250182dc 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,7 @@ +2011-10-17 Christopher Faylor + + * sigproc.cc (proc_terminate): Avoid setting ppid to 1 if we're execing. + 2011-10-15 Christopher Faylor * cygerrno.h (__set_errno): Modify debugging output to make searching diff --git a/winsup/cygwin/sigproc.cc b/winsup/cygwin/sigproc.cc index cd27f2642..f77472ba5 100644 --- a/winsup/cygwin/sigproc.cc +++ b/winsup/cygwin/sigproc.cc @@ -374,7 +374,15 @@ proc_terminate () int i; for (i = 0; i < nprocs; i++) { - procs[i]->ppid = 1; + extern child_info_spawn *chExeced; + /* Don't reset the ppid to 1 if this pid is still going to be + associated with a process. + FIXME: The problem with this simplistic approach is that the + ppid for any surviving children will never be set to 1 in + this scenario. A potential fix would be to move procs into + cygheap but that would complicate startup. What else is new? */ + if (!chExeced) + procs[i]->ppid = 1; if (procs[i].wait_thread) { // CloseHandle (procs[i].rd_proc_pipe);