ws2_32: Properly handle closing sockets during a select call.

Based on a patch by Bruno Jesus.
oldstable
Sebastian Lackner 2015-04-30 05:43:26 +02:00 committed by Alexandre Julliard
parent a248418325
commit 0d2817b161
2 changed files with 12 additions and 2 deletions

View File

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

View File

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