diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2009-11-23 12:21:39 +0000 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2009-11-23 12:21:39 +0000 |
commit | 013e402bfc6d661d5884cd65888be06fa6e19c4f (patch) | |
tree | b87995b934c62bb5efdb0008816b92e4a529cf84 /winsup/cygwin | |
parent | 83fb2eceda613a62ca5f03f32883049053e183d4 (diff) | |
download | newlib-013e402bfc6d661d5884cd65888be06fa6e19c4f.zip newlib-013e402bfc6d661d5884cd65888be06fa6e19c4f.tar.gz newlib-013e402bfc6d661d5884cd65888be06fa6e19c4f.tar.bz2 |
* fhandler_socket.cc (fhandler_socket::set_close_on_exec): Only call
fhandler_base::set_close_on_exec for inheritable sockets.
Diffstat (limited to 'winsup/cygwin')
-rw-r--r-- | winsup/cygwin/ChangeLog | 5 | ||||
-rw-r--r-- | winsup/cygwin/fhandler_socket.cc | 9 |
2 files changed, 12 insertions, 2 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 529daa2..ab6cf6f 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,8 @@ +2009-11-23 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_socket.cc (fhandler_socket::set_close_on_exec): Only call + fhandler_base::set_close_on_exec for inheritable sockets. + 2009-11-21 Corinna Vinschen <corinna@vinschen.de> * globals.cc (ro_u_dll): New R/O unicode string. diff --git a/winsup/cygwin/fhandler_socket.cc b/winsup/cygwin/fhandler_socket.cc index 6a66206..ba230df 100644 --- a/winsup/cygwin/fhandler_socket.cc +++ b/winsup/cygwin/fhandler_socket.cc @@ -2034,8 +2034,13 @@ fhandler_socket::set_close_on_exec (bool val) { set_no_inheritance (wsock_mtx, val); set_no_inheritance (wsock_evt, val); - fhandler_base::set_close_on_exec (val); - debug_printf ("set close_on_exec for %s to %d", get_name (), val); + if (need_fixup_before ()) + { + close_on_exec (val); + debug_printf ("set close_on_exec for %s to %d", get_name (), val); + } + else + fhandler_base::set_close_on_exec (val); } void |