* fhandler_socket.cc (fhandler_socket::dup): First try duplicating
using WSADuplicateSocket/WSASocket, if that fails, try DuplicateHandle.
This commit is contained in:
parent
2311f6b0e4
commit
dae86e4507
@ -1,3 +1,8 @@
|
||||
2003-05-27 Corinna Vinschen <corinna@vinschen.de>
|
||||
|
||||
* fhandler_socket.cc (fhandler_socket::dup): First try duplicating
|
||||
using WSADuplicateSocket/WSASocket, if that fails, try DuplicateHandle.
|
||||
|
||||
2003-05-27 Bill C. Riemers <cygwin@docbill.net>
|
||||
|
||||
* fhandler_disk_file.cc (fhandler_disk_file::fstat_helper): Filter
|
||||
|
@ -393,15 +393,16 @@ fhandler_socket::dup (fhandler_base *child)
|
||||
drop this for NT systems at all and return to the good ol'
|
||||
DuplicateHandle way of life. This worked fine all the time on
|
||||
NT anyway and it's even a bit faster. */
|
||||
if (!wincap.has_security ())
|
||||
WSASetLastError (0);
|
||||
fhs->fixup_before_fork_exec (GetCurrentProcessId ());
|
||||
if (WSAGetLastError () != WSAEINVAL && winsock2_active)
|
||||
{
|
||||
fhs->fixup_before_fork_exec (GetCurrentProcessId ());
|
||||
if (winsock2_active)
|
||||
{
|
||||
fhs->fixup_after_fork (hMainProc);
|
||||
return get_io_handle () == (HANDLE) INVALID_SOCKET;
|
||||
}
|
||||
fhs->fixup_after_fork (hMainProc);
|
||||
if (WSAGetLastError () != WSAEINVAL)
|
||||
return get_io_handle () == (HANDLE) INVALID_SOCKET;
|
||||
}
|
||||
|
||||
debug_printf ("WSADuplicateSocket failed, trying DuplicateHandle");
|
||||
/* We don't call fhandler_base::dup here since that requires to
|
||||
have winsock called from fhandler_base and it creates only
|
||||
inheritable sockets which is wrong for winsock2. */
|
||||
|
Loading…
Reference in New Issue
Block a user