Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2002-06-10 15:07:44 +0400
committerCorinna Vinschen <corinna@vinschen.de>2002-06-10 15:07:44 +0400
commit3d78e129b748bf686e606a64c0f44ece110f4c48 (patch)
tree803eae0cc5a15675df199215e04a639394cf1aa6 /winsup/cygwin/net.cc
parent43c3c4e37cdd286b3b8c85265e7cf5ff70c6437a (diff)
* fhandler.h (fhandler_socket::fixup_after_fork): Revert patch from
2002-06-04. * fhandler_socket.cc (fhandler_socket::fixup_after_fork): Ditto. (fhandler_socket::dup): Ditto. * net.cc (fdsock): Make sockets explicitely noninheritable on NT.
Diffstat (limited to 'winsup/cygwin/net.cc')
-rw-r--r--winsup/cygwin/net.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/winsup/cygwin/net.cc b/winsup/cygwin/net.cc
index 5e1fc8f60..7c2d2b5ca 100644
--- a/winsup/cygwin/net.cc
+++ b/winsup/cygwin/net.cc
@@ -501,6 +501,12 @@ fdsock (int& fd, const char *name, SOCKET soc)
{
if (!winsock2_active)
soc = set_socket_inheritance (soc);
+ else if (wincap.has_set_handle_information ())
+ {
+ /* NT systems apparently set sockets to inheritable by default */
+ SetHandleInformation ((HANDLE)soc, HANDLE_FLAG_INHERIT, 0);
+ debug_printf ("reset socket inheritance since winsock2_active %d", winsock2_active);
+ }
else
debug_printf ("not setting socket inheritance since winsock2_active %d", winsock2_active);
fhandler_socket *fh = (fhandler_socket *) cygheap->fdtab.build_fhandler (fd, FH_SOCKET, name);