diff options
author | Christopher Faylor <me@cgf.cx> | 2011-10-17 19:35:26 +0400 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2011-10-17 19:35:26 +0400 |
commit | e4257c736696e2f902bd06c96529fbfd98d13bbd (patch) | |
tree | 141afc923f8167680980e89e9272e5b557009b82 /winsup/cygwin/sigproc.cc | |
parent | 23771fa1f7028454def918e01f98a2edafe26b4e (diff) |
* sigproc.cc (proc_terminate): Avoid setting ppid to 1 if we're execing.
Diffstat (limited to 'winsup/cygwin/sigproc.cc')
-rw-r--r-- | winsup/cygwin/sigproc.cc | 10 |
1 files changed, 9 insertions, 1 deletions
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); |