aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2001-06-22 20:53:45 +0000
committerCorinna Vinschen <corinna@vinschen.de>2001-06-22 20:53:45 +0000
commit50b1264871afbdcb14a1fd5fae3fe3bc358c0bad (patch)
tree7b133ad01762bcf62f4690f2972b762be4003dec
parent3b295174e30f765dffeaf205ac7e8b515982c93e (diff)
downloadnewlib-50b1264871afbdcb14a1fd5fae3fe3bc358c0bad.zip
newlib-50b1264871afbdcb14a1fd5fae3fe3bc358c0bad.tar.gz
newlib-50b1264871afbdcb14a1fd5fae3fe3bc358c0bad.tar.bz2
* fhandler.h class fhandler_socket): Declare new method
`set_close_on_exec'. * fhandler_socket.cc (fhandler_socket::set_close_on_exec): New method.
-rw-r--r--winsup/cygwin/ChangeLog7
-rw-r--r--winsup/cygwin/fhandler.h1
-rw-r--r--winsup/cygwin/fhandler_socket.cc9
3 files changed, 17 insertions, 0 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index eae9eaf..8dcfe7f 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,3 +1,10 @@
+Fri Jun 22 16:50:00 2001 Corinna Vinschen <corinna@vinschen.de>
+
+ * fhandler.h class fhandler_socket): Declare new method
+ `set_close_on_exec'.
+ * fhandler_socket.cc (fhandler_socket::set_close_on_exec):
+ New method.
+
Fri Jun 22 16:12:00 2001 Corinna Vinschen <corinna@vinschen.de>
* fhandler_tape.cc (fhandler_dev_tape::tape_erase): Set size
diff --git a/winsup/cygwin/fhandler.h b/winsup/cygwin/fhandler.h
index c6224d0..8c34c19 100644
--- a/winsup/cygwin/fhandler.h
+++ b/winsup/cygwin/fhandler.h
@@ -383,6 +383,7 @@ public:
void hclose (HANDLE) {close ();}
int dup (fhandler_base *child);
+ void set_close_on_exec (int val);
virtual void fixup_before_fork_exec (DWORD);
void fixup_after_fork (HANDLE);
void fixup_after_exec (HANDLE parent) { fixup_after_fork (parent); }
diff --git a/winsup/cygwin/fhandler_socket.cc b/winsup/cygwin/fhandler_socket.cc
index 3ec1ac6..974f2de 100644
--- a/winsup/cygwin/fhandler_socket.cc
+++ b/winsup/cygwin/fhandler_socket.cc
@@ -431,3 +431,12 @@ fhandler_socket::fcntl (int cmd, void *arg)
return res;
}
+void
+fhandler_socket::set_close_on_exec (int val)
+{
+ extern WSADATA wsadata;
+ if (wsadata.wVersion < 512) /* < Winsock 2.0 */
+ set_inheritance (get_handle (), val);
+ set_close_on_exec_flag (val);
+ debug_printf ("set close_on_exec for %s to %d", get_name (), val);
+}