diff options
author | Christopher Faylor <me@cgf.cx> | 2012-05-02 20:39:39 +0400 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2012-05-02 20:39:39 +0400 |
commit | b79c0094f8a9bee17aacd59fe7e0334228a8fae8 (patch) | |
tree | dc7c0159ce1942db8baef6665fd9d1da2dc3d965 /winsup/cygwin/sigproc.cc | |
parent | 03cd7bbbb161b2b3c163eadc7d42aa6f23e2a516 (diff) |
* 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.
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 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 (); } |