ws2_32: Properly handle closing sockets during a select call.
Based on a patch by Bruno Jesus.
This commit is contained in:
parent
a248418325
commit
0d2817b161
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue