From d8f962e69cb92e4a6cc438394cff42779621af16 Mon Sep 17 00:00:00 2001 From: Rein Klazes Date: Fri, 24 Jul 2009 10:29:17 +0200 Subject: [PATCH] ws2_32: Do not make the unix file descriptor blocking. Too many places in the socket code assume it is not. --- dlls/ws2_32/socket.c | 24 +++++------------------- 1 file changed, 5 insertions(+), 19 deletions(-) diff --git a/dlls/ws2_32/socket.c b/dlls/ws2_32/socket.c index 14926402de..2eb5837773 100644 --- a/dlls/ws2_32/socket.c +++ b/dlls/ws2_32/socket.c @@ -2406,25 +2406,11 @@ int WINAPI WS_ioctlsocket(SOCKET s, LONG cmd, WS_u_long *argp) SetLastError(WSAEINVAL); return SOCKET_ERROR; } - fd = get_sock_fd( s, 0, NULL ); - if (fd != -1) - { - int ret; - if (*argp) - { - _enable_event(SOCKET2HANDLE(s), 0, FD_WINE_NONBLOCKING, 0); - ret = fcntl( fd, F_SETFL, O_NONBLOCK ); - } - else - { - _enable_event(SOCKET2HANDLE(s), 0, 0, FD_WINE_NONBLOCKING); - ret = fcntl( fd, F_SETFL, 0 ); - } - release_sock_fd( s, fd ); - if (!ret) return 0; - SetLastError((errno == EBADF) ? WSAENOTSOCK : wsaErrno()); - } - return SOCKET_ERROR; + if (*argp) + _enable_event(SOCKET2HANDLE(s), 0, FD_WINE_NONBLOCKING, 0); + else + _enable_event(SOCKET2HANDLE(s), 0, 0, FD_WINE_NONBLOCKING); + return 0; case WS_SIOCATMARK: newcmd=SIOCATMARK;