* 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.
This commit is contained in:
Christopher Faylor 2012-03-19 16:51:30 +00:00
parent 4aeaedf961
commit d9492ab8d2
2 changed files with 14 additions and 5 deletions

View File

@ -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.

View File

@ -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 */