OSDN Git Service

* include/sys/file.h: Move X_OK protection earlier.
authorcgf <cgf>
Fri, 20 Apr 2001 15:50:03 +0000 (15:50 +0000)
committercgf <cgf>
Fri, 20 Apr 2001 15:50:03 +0000 (15:50 +0000)
* dtable.cc (dtable::vfork_child_fixup): Avoid closing already closed handles.

winsup/cygwin/ChangeLog
winsup/cygwin/dtable.cc
winsup/cygwin/include/sys/file.h

index 7fdb1f9..816190f 100644 (file)
@@ -1,3 +1,10 @@
+Fri Apr 20 11:48:45 2001  Christopher Faylor <cgf@cygnus.com>
+
+       * include/sys/file.h: Move X_OK protection earlier.
+
+       * dtable.cc (dtable::vfork_child_fixup): Avoid closing already closed
+       handles.
+
 Fri Apr 20 16:29:00 2001  Corinna Vinschen <corinna@vinschen.de>
 
        * grp.cc (getgroups): Change so that SIDs get compared instead
index b5f9a91..88c3adc 100644 (file)
@@ -580,9 +580,14 @@ dtable::vfork_child_fixup ()
   for (int i = 0; i < (int) cygheap->fdtab.size; i++)
     if ((fh = cygheap->fdtab[i]) != NULL)
       {
-        fh->close ();
        fh->clear_readahead ();
-        cygheap->fdtab.release (i);
+       if (fh->get_close_on_exec ())
+         release (i);
+       else
+         {
+           fh->close ();
+           cygheap->fdtab.release (i);
+         }
       }
 
   fds = saveme;
index 9a63695..85f9f4c 100644 (file)
 
 #define        F_OK            0       /* does file exist */
 #define        _X_OK           1       /* is it executable by caller */
+#undef X_OK
 #if defined (__CYGWIN__) || defined (__INSIDE_CYGWIN__)
 # define X_OK  _X_OK   /* Check for execute permission. */
 #else
-# undef X_OK
 extern const unsigned _cygwin_X_OK;
 # define X_OK  _cygwin_X_OK
 #endif