about summary refs log tree commit diff
path: root/sysdeps/pthread/aio_cancel.c
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/pthread/aio_cancel.c')
-rw-r--r--sysdeps/pthread/aio_cancel.c8
1 files changed, 7 insertions, 1 deletions
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;