* 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.
This commit is contained in:
Corinna Vinschen
2002-06-10 11:07:44 +00:00
parent 43c3c4e37c
commit 3d78e129b7
4 changed files with 17 additions and 15 deletions

View File

@ -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);