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>2001-04-20 19:50:03 +0400
committerChristopher Faylor <me@cgf.cx>2001-04-20 19:50:03 +0400
commitcdcfe4e8e9d71c9b0d18029baac6f2fb167afc21 (patch)
treee5d8c49cf3154099f6ba57fa40c945b59f15fa9e
parentbfbc1aecdca4f960234d3eb9e524b22fe6573f02 (diff)
* include/sys/file.h: Move X_OK protection earlier.
* dtable.cc (dtable::vfork_child_fixup): Avoid closing already closed handles.
-rw-r--r--winsup/cygwin/ChangeLog7
-rw-r--r--winsup/cygwin/dtable.cc9
-rw-r--r--winsup/cygwin/include/sys/file.h2
3 files changed, 15 insertions, 3 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index 7fdb1f96e..816190f68 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -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
diff --git a/winsup/cygwin/dtable.cc b/winsup/cygwin/dtable.cc
index b5f9a9136..88c3adced 100644
--- a/winsup/cygwin/dtable.cc
+++ b/winsup/cygwin/dtable.cc
@@ -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;
diff --git a/winsup/cygwin/include/sys/file.h b/winsup/cygwin/include/sys/file.h
index 9a63695df..85f9f4c74 100644
--- a/winsup/cygwin/include/sys/file.h
+++ b/winsup/cygwin/include/sys/file.h
@@ -25,10 +25,10 @@
#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