server: Change cancel_async to take an optional iosb and only_thread.
diff --git a/server/sock.c b/server/sock.c
index baaa9df..71d8ccb 100644
--- a/server/sock.c
+++ b/server/sock.c
@@ -97,7 +97,7 @@
static enum server_fd_type sock_get_fd_type( struct fd *fd );
static void sock_queue_async( struct fd *fd, const async_data_t *data, int type, int count );
static void sock_reselect_async( struct fd *fd, struct async_queue *queue );
-static void sock_cancel_async( struct fd *fd );
+static void sock_cancel_async( struct fd *fd, struct process *process, struct thread *thread, client_ptr_t iosb );
static int sock_get_error( int err );
static void sock_set_error(void);
@@ -538,13 +538,16 @@
if (events) sock_try_event( sock, events );
}
-static void sock_cancel_async( struct fd *fd )
+static void sock_cancel_async( struct fd *fd, struct process *process, struct thread *thread, client_ptr_t iosb )
{
struct sock *sock = get_fd_user( fd );
+ int n = 0;
assert( sock->obj.ops == &sock_ops );
- async_wake_up( sock->read_q, STATUS_CANCELLED );
- async_wake_up( sock->write_q, STATUS_CANCELLED );
+ n += async_wake_up_by( sock->read_q, process, thread, iosb, STATUS_CANCELLED );
+ n += async_wake_up_by( sock->write_q, process, thread, iosb, STATUS_CANCELLED );
+ if (!n && iosb)
+ set_error( STATUS_NOT_FOUND );
}
static struct fd *sock_get_fd( struct object *obj )