* DevNotes: Add entry cgf-000004.

* pinfo.cc (pinfo::init): Reuse shared memory if the state is marked with
PID_REAPED.
* spawn.cc (child_info_spawn::worker): Don't duplicate myself_pinfo into
non-cygwin child.
* fork.cc (frok::parent): Improve error output.
This commit is contained in:
Christopher Faylor
2012-05-08 15:06:43 +00:00
parent 51180c08ed
commit dfd5d5bea6
5 changed files with 60 additions and 8 deletions

View File

@@ -300,6 +300,13 @@ pinfo::init (pid_t n, DWORD flag, HANDLE h0)
bool created = shloc != SH_JUSTOPEN;
if (!created && createit && (procinfo->process_state & PID_REAPED))
{
memset (procinfo, 0, sizeof (*procinfo));
created = true; /* Lie that we created this - just reuse old
shared memory */
}
if ((procinfo->process_state & PID_REAPED)
|| ((procinfo->process_state & PID_INITIALIZING) && (flag & PID_NOREDIR)
&& cygwin_pid (procinfo->dwProcessId) != procinfo->pid))