From e4257c736696e2f902bd06c96529fbfd98d13bbd Mon Sep 17 00:00:00 2001 From: Christopher Faylor Date: Mon, 17 Oct 2011 15:35:26 +0000 Subject: * sigproc.cc (proc_terminate): Avoid setting ppid to 1 if we're execing. --- winsup/cygwin/sigproc.cc | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'winsup/cygwin/sigproc.cc') 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); -- cgit v1.2.3