summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--winsup/cygwin/ChangeLog6
-rw-r--r--winsup/cygwin/pinfo.cc13
2 files changed, 14 insertions, 5 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index ebcf00afd..3c25957d1 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,3 +1,9 @@
+2012-03-19 Christopher Faylor <me.cygwin2012@cgf.cx>
+
+ * 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.
+
2012-03-16 Christopher Faylor <me.cygwin2012@cgf.cx>
* fork.cc (lock_signals): Move to sigproc.h.
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 */