From b79c0094f8a9bee17aacd59fe7e0334228a8fae8 Mon Sep 17 00:00:00 2001 From: Christopher Faylor Date: Wed, 2 May 2012 16:39:39 +0000 Subject: * ChangeNotes: New file. Add entry cgf-000001. * sigproc.cc (proc_terminate): Don't set parent pid of child to 1 if we've execed since the execed process is still considered the parent. * child_info.h: Bump copyright. --- 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 c9a76d85f..05d98729f 100644 --- a/winsup/cygwin/sigproc.cc +++ b/winsup/cygwin/sigproc.cc @@ -445,9 +445,17 @@ proc_terminate () /* Clean out proc processes from the pid list. */ for (int i = 0; i < nprocs; i++) { - procs[i]->ppid = 1; + /* If we've execed then the execed process will handle setting ppid + to 1 iff it is a Cygwin process. */ + if (!have_execed || !have_execed_cygwin) + procs[i]->ppid = 1; if (procs[i].wait_thread) procs[i].wait_thread->terminate_thread (); + /* Release memory associated with this process unless it is 'myself'. + 'myself' is only in the procs table when we've execed. We reach + here when the next process has finished initializing but we still + can't free the memory used by 'myself' since it is used later on + during cygwin tear down. */ if (procs[i] != myself) procs[i].release (); } -- cgit v1.2.3