OSDN Git Service

* fork.cc (fork): Reset child to true after fork since it may have been reset
authorcgf <cgf>
Thu, 1 Mar 2007 18:43:38 +0000 (18:43 +0000)
committercgf <cgf>
Thu, 1 Mar 2007 18:43:38 +0000 (18:43 +0000)
by fork memory copies.

winsup/cygwin/ChangeLog
winsup/cygwin/fork.cc

index 00ee93c..64c1598 100644 (file)
@@ -1,5 +1,10 @@
 2007-03-01  Christopher Faylor  <me@cgf.cx>
 
+       * fork.cc (fork): Reset child to true after fork since it may have been
+       reset by fork memory copies.
+
+2007-03-01  Christopher Faylor  <me@cgf.cx>
+
        * Makefile (DLL_OFILES): Remove ntea.o
        * environ.cc (set_ntea): Delete.
        (parse_thing): Delete "ntea" setting.
index dc59e4f..e1b546d 100644 (file)
@@ -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;