Commit 41cdc667 authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

server: Report the socket error in sock_poll_event() on POLLERR or POLLHUP.

parent a2f2b773
......@@ -162,7 +162,8 @@ static void check_poll_(int line, SOCKET s, HANDLE event, int mask, int expect,
ok_(__FILE__, line)(out_params.count == 1, "got count %u\n", out_params.count);
ok_(__FILE__, line)(out_params.sockets[0].socket == s, "got socket %#Ix\n", out_params.sockets[0].socket);
todo_wine_if (todo) ok_(__FILE__, line)(out_params.sockets[0].flags == expect, "got flags %#x\n", out_params.sockets[0].flags);
ok_(__FILE__, line)(!out_params.sockets[0].status, "got status %#x\n", out_params.sockets[0].status);
todo_wine_if (expect & AFD_POLL_RESET)
ok_(__FILE__, line)(!out_params.sockets[0].status, "got status %#x\n", out_params.sockets[0].status);
}
static void test_poll(void)
......
......@@ -1145,6 +1145,9 @@ static void sock_poll_event( struct fd *fd, int event )
if (debug_level)
fprintf(stderr, "socket %p select event: %x\n", sock, event);
if (event & (POLLERR | POLLHUP))
error = sock_error( sock );
switch (sock->state)
{
case SOCK_UNCONNECTED:
......@@ -1153,7 +1156,6 @@ static void sock_poll_event( struct fd *fd, int event )
case SOCK_CONNECTING:
if (event & (POLLERR|POLLHUP))
{
error = sock_error( sock );
sock->state = SOCK_UNCONNECTED;
event &= ~POLLOUT;
}
......@@ -1166,8 +1168,6 @@ static void sock_poll_event( struct fd *fd, int event )
break;
case SOCK_LISTENING:
if (event & (POLLERR|POLLHUP))
error = sock_error( sock );
break;
case SOCK_CONNECTED:
......
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