summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/fork.cc
diff options
context:
space:
mode:
Diffstat (limited to 'winsup/cygwin/fork.cc')
-rw-r--r--winsup/cygwin/fork.cc7
1 files changed, 5 insertions, 2 deletions
diff --git a/winsup/cygwin/fork.cc b/winsup/cygwin/fork.cc
index dc59e4f70..e1b546d97 100644
--- a/winsup/cygwin/fork.cc
+++ b/winsup/cygwin/fork.cc
@@ -94,6 +94,7 @@ public:
class hold_everything
{
+public: /* DELETEME*/
bool& ischild;
/* Note the order of the locks below. It is important,
to avoid races, that the lock order be preserved.
@@ -620,11 +621,13 @@ fork ()
volatile char * volatile esp;
__asm__ volatile ("movl %%esp,%0": "=r" (esp));
-
if (!ischild)
res = grouped.parent (esp);
else
- res = grouped.child (esp);
+ {
+ res = grouped.child (esp);
+ ischild = true; /* might have been reset by fork mem copy */
+ }
}
MALLOC_CHECK;