From 7b787f8516c039ed56b1bc3f511eb1165526061b Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Fri, 25 Jul 2003 07:56:33 +0000 Subject: Update. 2003-07-24 Jakub Jelinek * sysdeps/pthread/aio_cancel.c (aio_cancel): Return AIO_ALLDONE if aiocbp != NULL and has already completed. Return -1/EINVAL if aiocbp->aio_fildes does not match fildes. --- sysdeps/pthread/aio_cancel.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'sysdeps') diff --git a/sysdeps/pthread/aio_cancel.c b/sysdeps/pthread/aio_cancel.c index b2f7be1935..a37b2c7896 100644 --- a/sysdeps/pthread/aio_cancel.c +++ b/sysdeps/pthread/aio_cancel.c @@ -60,7 +60,13 @@ aio_cancel (fildes, aiocbp) { /* If the AIO request is not for this descriptor it has no value to look for the request block. */ - if (aiocbp->aio_fildes == fildes) + if (aiocbp->aio_fildes != fildes) + { + pthread_mutex_unlock (&__aio_requests_mutex); + __set_errno (EINVAL); + return -1; + } + else if (aiocbp->__error_code == EINPROGRESS) { struct requestlist *last = NULL; -- cgit v1.2.3