Commit a2f2b773 authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

server: Record the error for connected and connectionless sockets sockets in sock_error().

As long as we do it for connecting and listening sockets, do it here for the remaining socket types as well.
parent a1fd99cf
......@@ -645,20 +645,35 @@ static inline int sock_error( struct sock *sock )
socklen_t len = sizeof(error);
getsockopt( get_unix_fd(sock->fd), SOL_SOCKET, SO_ERROR, (void *)&error, &len);
if (sock->state == SOCK_CONNECTING)
switch (sock->state)
{
case SOCK_UNCONNECTED:
break;
case SOCK_CONNECTING:
if (error)
sock->errors[AFD_POLL_BIT_CONNECT_ERR] = error;
else
error = sock->errors[AFD_POLL_BIT_CONNECT_ERR];
}
else if (sock->state == SOCK_LISTENING)
{
break;
case SOCK_LISTENING:
if (error)
sock->errors[AFD_POLL_BIT_ACCEPT] = error;
else
error = sock->errors[AFD_POLL_BIT_ACCEPT];
break;
case SOCK_CONNECTED:
case SOCK_CONNECTIONLESS:
if (error)
sock->errors[AFD_POLL_BIT_HUP] = error;
else
error = sock->errors[AFD_POLL_BIT_HUP];
break;
}
return error;
}
......
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