mirror of
git://sourceware.org/git/newlib-cygwin.git
synced 2025-01-31 03:20:28 +08:00
2003-03-11 Corinna Vinschen <corinna@vinschen.de>
* fhandler_socket.cc (fhandler_socket::dup): On NT systems avoid using WinSock2 socket duplication methods. Add comment. 2003-03-11 Pierre Humblet <pierre.humblet@ieee.org> * fhandler_socket.cc (fhandler_socket::fixup_after_fork): Set io_handle to INVALID_SOCKET in case of failure. (fhandler_socket::dup): Return 0 if the io_handle is valid.
This commit is contained in:
parent
970f752c8c
commit
2afa7f5882
@ -1,3 +1,14 @@
|
|||||||
|
2003-03-11 Corinna Vinschen <corinna@vinschen.de>
|
||||||
|
|
||||||
|
* fhandler_socket.cc (fhandler_socket::dup): On NT systems avoid
|
||||||
|
using WinSock2 socket duplication methods. Add comment.
|
||||||
|
|
||||||
|
2003-03-11 Pierre Humblet <pierre.humblet@ieee.org>
|
||||||
|
|
||||||
|
* fhandler_socket.cc (fhandler_socket::fixup_after_fork):
|
||||||
|
Set io_handle to INVALID_SOCKET in case of failure.
|
||||||
|
(fhandler_socket::dup): Return 0 if the io_handle is valid.
|
||||||
|
|
||||||
2003-03-10 Corinna Vinschen <corinna@vinschen.de>
|
2003-03-10 Corinna Vinschen <corinna@vinschen.de>
|
||||||
|
|
||||||
* sec_acl.cc (setacl): Don't handle DELETE flag specially.
|
* sec_acl.cc (setacl): Don't handle DELETE flag specially.
|
||||||
|
@ -344,6 +344,7 @@ fhandler_socket::fixup_after_fork (HANDLE parent)
|
|||||||
prot_info_ptr, 0, 0)) == INVALID_SOCKET)
|
prot_info_ptr, 0, 0)) == INVALID_SOCKET)
|
||||||
{
|
{
|
||||||
debug_printf ("WSASocket error");
|
debug_printf ("WSASocket error");
|
||||||
|
set_io_handle ((HANDLE)INVALID_SOCKET);
|
||||||
set_winsock_errno ();
|
set_winsock_errno ();
|
||||||
}
|
}
|
||||||
else if (!new_sock && !winsock2_active)
|
else if (!new_sock && !winsock2_active)
|
||||||
@ -385,11 +386,19 @@ fhandler_socket::dup (fhandler_base *child)
|
|||||||
fhs->set_sun_path (get_sun_path ());
|
fhs->set_sun_path (get_sun_path ());
|
||||||
fhs->set_socket_type (get_socket_type ());
|
fhs->set_socket_type (get_socket_type ());
|
||||||
|
|
||||||
|
/* Using WinSock2 methods for dup'ing sockets seem to collide
|
||||||
|
with user context switches under... some... conditions. So we
|
||||||
|
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 ())
|
||||||
|
{
|
||||||
fhs->fixup_before_fork_exec (GetCurrentProcessId ());
|
fhs->fixup_before_fork_exec (GetCurrentProcessId ());
|
||||||
if (winsock2_active)
|
if (winsock2_active)
|
||||||
{
|
{
|
||||||
fhs->fixup_after_fork (hMainProc);
|
fhs->fixup_after_fork (hMainProc);
|
||||||
return 0;
|
return get_io_handle () == (HANDLE) INVALID_SOCKET;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return fhandler_base::dup (child);
|
return fhandler_base::dup (child);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user