* sigproc.cc (proc_terminate): Avoid setting ppid to 1 if we're execing.

This commit is contained in:
Christopher Faylor 2011-10-17 15:35:26 +00:00
parent 23771fa1f7
commit e4257c7366
2 changed files with 13 additions and 1 deletions

View File

@ -1,3 +1,7 @@
2011-10-17 Christopher Faylor <me.cygwin2011@cgf.cx>
* sigproc.cc (proc_terminate): Avoid setting ppid to 1 if we're execing.
2011-10-15 Christopher Faylor <me.cygwin2011@cgf.cx>
* cygerrno.h (__set_errno): Modify debugging output to make searching

View File

@ -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);