Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2011-10-17 19:35:26 +0400
committerChristopher Faylor <me@cgf.cx>2011-10-17 19:35:26 +0400
commite4257c736696e2f902bd06c96529fbfd98d13bbd (patch)
tree141afc923f8167680980e89e9272e5b557009b82 /winsup/cygwin/sigproc.cc
parent23771fa1f7028454def918e01f98a2edafe26b4e (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.cc10
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);