aboutsummaryrefslogtreecommitdiff
path: root/winsup/cygwin/fhandler_socket.cc
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2001-09-20 11:35:49 +0000
committerCorinna Vinschen <corinna@vinschen.de>2001-09-20 11:35:49 +0000
commita2db3c9288de0329591f7cdd3f87af2c020b4be4 (patch)
treee574e87d68795b1a025f7e7c10538c46ac0ccf5b /winsup/cygwin/fhandler_socket.cc
parent8e54fb88f368b4f582d2f40b42056d730dd229bc (diff)
downloadnewlib-a2db3c9288de0329591f7cdd3f87af2c020b4be4.zip
newlib-a2db3c9288de0329591f7cdd3f87af2c020b4be4.tar.gz
newlib-a2db3c9288de0329591f7cdd3f87af2c020b4be4.tar.bz2
* fhandler_socket.cc (fhandler_socket::fixup_after_exec): Close
socket only when not using Winsock2.
Diffstat (limited to 'winsup/cygwin/fhandler_socket.cc')
-rw-r--r--winsup/cygwin/fhandler_socket.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/winsup/cygwin/fhandler_socket.cc b/winsup/cygwin/fhandler_socket.cc
index dc76d0e..dbf284e 100644
--- a/winsup/cygwin/fhandler_socket.cc
+++ b/winsup/cygwin/fhandler_socket.cc
@@ -214,9 +214,10 @@ fhandler_socket::fixup_after_fork (HANDLE parent)
void
fhandler_socket::fixup_after_exec (HANDLE parent)
{
+ extern WSADATA wsadata;
if (!get_close_on_exec ())
fixup_after_fork (parent);
- else
+ else if (wsadata.wVersion < 512) /* < Winsock 2.0 */
closesocket (get_socket ());
}