aboutsummaryrefslogtreecommitdiff
path: root/winsup/cygwin/fhandler_socket.cc
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 /winsup/cygwin/fhandler_socket.cc
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.
Diffstat (limited to 'winsup/cygwin/fhandler_socket.cc')
-rw-r--r--winsup/cygwin/fhandler_socket.cc9
1 files changed, 9 insertions, 0 deletions
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);
+}