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:
authorMichael Haubenwallner <michael.haubenwallner@ssi-schaefer.com>2019-07-31 13:35:31 +0300
committerCorinna Vinschen <corinna-cygwin@cygwin.com>2019-07-31 14:27:47 +0300
commit23a779bf3d7c2afc9eab88f6b8727c1db5544547 (patch)
tree959b61750d0f6bcd7bfc410c2d39d0852d0e5119 /winsup/cygwin/sigproc.cc
parent6661a67747c14cfa7ac91458914037ee296fcd1e (diff)
Cygwin: pinfo: stop remember doing reattach
During fork, the child process requires the process table to be initialized for fixup_shms_after_fork, while still allowing subsequent dlls.load_after_fork to fail silently (for when the "forkable" hardlinks are not created yet). pinfo::remember not performing reattach anymore requires explicit pinfo::reattach now where appropriate. Prepares to improve "Cygwin: fork: Remember child not before success." commit f03ea8e1c57bd5cea83f6cd47fa02870bdfeb1c5, which leads to fork problems if cygserver is running: https://cygwin.com/ml/cygwin-patches/2019-q2/msg00155.html
Diffstat (limited to 'winsup/cygwin/sigproc.cc')
-rw-r--r--winsup/cygwin/sigproc.cc7
1 files changed, 3 insertions, 4 deletions
diff --git a/winsup/cygwin/sigproc.cc b/winsup/cygwin/sigproc.cc
index 900facd58..8003e2db6 100644
--- a/winsup/cygwin/sigproc.cc
+++ b/winsup/cygwin/sigproc.cc
@@ -216,9 +216,7 @@ proc_subproc (DWORD what, uintptr_t val)
vchild->process_state |= PID_INITIALIZING;
vchild->ppid = what == PROC_DETACHED_CHILD ? 1 : myself->pid; /* always set last */
}
- if (what == PROC_DETACHED_CHILD)
- break;
- /* fall through intentionally */
+ break;
case PROC_REATTACH_CHILD:
procs[nprocs] = vchild;
@@ -873,7 +871,8 @@ void
child_info_spawn::wait_for_myself ()
{
postfork (myself);
- myself.remember (false);
+ if (myself.remember (false))
+ myself.reattach ();
WaitForSingleObject (ev, INFINITE);
}