Commit 8d9fbe59 authored by Mike Kaplinskiy's avatar Mike Kaplinskiy Committed by Alexandre Julliard

server: Forward the correct error to asyncs.

parent be230adb
......@@ -295,7 +295,7 @@ static inline int sock_error( struct fd *fd )
return optval;
}
static void sock_dispatch_asyncs( struct sock *sock, int event )
static void sock_dispatch_asyncs( struct sock *sock, int event, int error )
{
if ( sock->flags & WSA_FLAG_OVERLAPPED )
{
......@@ -311,10 +311,12 @@ static void sock_dispatch_asyncs( struct sock *sock, int event )
}
if ( event & (POLLERR|POLLHUP) )
{
int status = sock_get_ntstatus( error );
if ( !(sock->state & FD_READ) )
async_wake_up( sock->read_q, STATUS_SUCCESS );
async_wake_up( sock->read_q, status );
if ( !(sock->state & FD_WRITE) )
async_wake_up( sock->write_q, STATUS_SUCCESS );
async_wake_up( sock->write_q, status );
}
}
}
......@@ -449,7 +451,7 @@ static void sock_poll_event( struct fd *fd, int event )
event |= POLLHUP;
}
sock_dispatch_asyncs( sock, event );
sock_dispatch_asyncs( sock, event, error );
sock_dispatch_events( sock, prevstate, event, error );
/* if anyone is stupid enough to wait on the socket object itself,
......
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