summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/fhandler_socket.cc
diff options
context:
space:
mode:
Diffstat (limited to 'winsup/cygwin/fhandler_socket.cc')
-rw-r--r--winsup/cygwin/fhandler_socket.cc9
1 files changed, 7 insertions, 2 deletions
diff --git a/winsup/cygwin/fhandler_socket.cc b/winsup/cygwin/fhandler_socket.cc
index 6a6620686..ba230dff1 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