Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2012-05-08 19:06:43 +0400
committerChristopher Faylor <me@cgf.cx>2012-05-08 19:06:43 +0400
commitdfd5d5bea614c4ce80ea90e73a0d47d071e3efa1 (patch)
tree218a6bdb2329e824d78be456e476e8839d347d2b /winsup/cygwin/pinfo.cc
parent51180c08ed6a11a2dab5dc8b591bab1e84054118 (diff)
* 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.
Diffstat (limited to 'winsup/cygwin/pinfo.cc')
-rw-r--r--winsup/cygwin/pinfo.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/winsup/cygwin/pinfo.cc b/winsup/cygwin/pinfo.cc
index daed1cc7b..fda0abc9a 100644
--- a/winsup/cygwin/pinfo.cc
+++ b/winsup/cygwin/pinfo.cc
@@ -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))