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>2007-03-01 21:43:38 +0300
committerChristopher Faylor <me@cgf.cx>2007-03-01 21:43:38 +0300
commite943a1a37ee4febeb856c39d03e6d38692f6a3e6 (patch)
treea0c4fbd921ad1f805595378cad120faaaa363cca /winsup/cygwin/fork.cc
parent6e070c257c9026b433cdae7b0ad7f2ba909558bf (diff)
* fork.cc (fork): Reset child to true after fork since it may have been reset
by fork memory copies.
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;