diff options
author | Christopher Faylor <me@cgf.cx> | 2012-03-19 20:51:30 +0400 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2012-03-19 20:51:30 +0400 |
commit | d9492ab8d2d7aa90f6ac0fe2928e001c5a4f01fa (patch) | |
tree | 1d75ffe323160c53ca8b3898183eb971e5037e88 /winsup/cygwin/pinfo.cc | |
parent | 4aeaedf961029e38cd9c97ac1e32ba91406c9e23 (diff) |
* pinfo.cc (pinfo::wait): Handle case where prefork was not called prior to
calling wait(). This is the case when we are reabsorbing processes after being
execed.
Diffstat (limited to 'winsup/cygwin/pinfo.cc')
-rw-r--r-- | winsup/cygwin/pinfo.cc | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/winsup/cygwin/pinfo.cc b/winsup/cygwin/pinfo.cc index c5e646455..bc0de4735 100644 --- a/winsup/cygwin/pinfo.cc +++ b/winsup/cygwin/pinfo.cc @@ -987,12 +987,15 @@ proc_waiter (void *arg) bool pinfo::wait () { - rd_proc_pipe = pending_rd_proc_pipe; - pending_rd_proc_pipe = NULL; + if (pending_rd_proc_pipe) + { + rd_proc_pipe = pending_rd_proc_pipe; + pending_rd_proc_pipe = NULL; - wr_proc_pipe () = pending_wr_proc_pipe; - ForceCloseHandle1 (pending_wr_proc_pipe, wr_proc_pipe); - pending_wr_proc_pipe = NULL; + wr_proc_pipe () = pending_wr_proc_pipe; + ForceCloseHandle1 (pending_wr_proc_pipe, wr_proc_pipe); + pending_wr_proc_pipe = NULL; + } preserve (); /* Preserve the shared memory associated with the pinfo */ |