Commit 0d2817b1 authored by Sebastian Lackner's avatar Sebastian Lackner Committed by Alexandre Julliard

ws2_32: Properly handle closing sockets during a select call.

Based on a patch by Bruno Jesus.
parent a2484183
......@@ -4773,7 +4773,18 @@ static void release_poll_fds( const WS_fd_set *readfds, const WS_fd_set *writefd
if (exceptfds)
{
for (i = 0; i < exceptfds->fd_count; i++, j++)
if (fds[j].fd != -1) release_sock_fd( exceptfds->fd_array[i], fds[j].fd );
{
if (fds[j].fd == -1) continue;
release_sock_fd( exceptfds->fd_array[i], fds[j].fd );
if (fds[j].revents & POLLHUP)
{
int fd = get_sock_fd( exceptfds->fd_array[i], 0, NULL );
if (fd != -1)
release_sock_fd( exceptfds->fd_array[i], fd );
else
fds[j].revents = 0;
}
}
}
}
......
......@@ -3834,7 +3834,6 @@ todo_wine
FD_ZERO_ALL();
FD_SET_ALL(fdWrite);
ret = select(0, &readfds, NULL, &exceptfds, &select_timeout);
todo_wine
ok(ret == 1, "expected 1, got %d\n", ret);
ok(FD_ISSET(fdWrite, &readfds), "fdWrite socket is not in the set\n");
WaitForSingleObject (thread_handle, 1000);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment