+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.
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 */