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.cc16
1 files changed, 3 insertions, 13 deletions
diff --git a/winsup/cygwin/fhandler_socket.cc b/winsup/cygwin/fhandler_socket.cc
index 945088756..3ef35687e 100644
--- a/winsup/cygwin/fhandler_socket.cc
+++ b/winsup/cygwin/fhandler_socket.cc
@@ -183,7 +183,7 @@ fhandler_socket::fixup_before_fork_exec (DWORD win_proc_id)
extern "C" void __stdcall load_wsock32 ();
void
-fhandler_socket::fixup_after_fork (bool dup, HANDLE parent)
+fhandler_socket::fixup_after_fork (HANDLE parent)
{
SOCKET new_sock;
@@ -207,10 +207,6 @@ fhandler_socket::fixup_after_fork (bool dup, HANDLE parent)
else
{
debug_printf ("WSASocket went fine new_sock %p, old_sock %p", new_sock, get_io_handle ());
-#if 1
- if (!dup && new_sock != (SOCKET) get_socket ())
- closesocket (get_socket ());
-#endif
set_io_handle ((HANDLE) new_sock);
}
@@ -219,17 +215,11 @@ fhandler_socket::fixup_after_fork (bool dup, HANDLE parent)
}
void
-fhandler_socket::fixup_after_fork (HANDLE parent)
-{
- fixup_after_fork (false, parent);
-}
-
-void
fhandler_socket::fixup_after_exec (HANDLE parent)
{
debug_printf ("here");
if (!get_close_on_exec ())
- fixup_after_fork (false, parent);
+ fixup_after_fork (parent);
#if 0
else if (!winsock2_active)
closesocket (get_socket ());
@@ -247,7 +237,7 @@ fhandler_socket::dup (fhandler_base *child)
fhs->fixup_before_fork_exec (GetCurrentProcessId ());
if (winsock2_active)
{
- fhs->fixup_after_fork (true, hMainProc);
+ fhs->fixup_after_fork (hMainProc);
return 0;
}
return fhandler_base::dup (child);