about summary refs log tree commit diff
path: root/sysdeps/pthread/aio_cancel.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2003-07-25 07:56:33 +0000
committerUlrich Drepper <drepper@redhat.com>2003-07-25 07:56:33 +0000
commit7b787f8516c039ed56b1bc3f511eb1165526061b (patch)
tree23522977702d05b9e5aacbcaf115ff165841b404 /sysdeps/pthread/aio_cancel.c
parent02ade8d6b0058becfb8d3156e8b9cc3519bfb4bb (diff)
downloadglibc-7b787f8516c039ed56b1bc3f511eb1165526061b.tar.gz
glibc-7b787f8516c039ed56b1bc3f511eb1165526061b.tar.xz
glibc-7b787f8516c039ed56b1bc3f511eb1165526061b.zip
Update.
2003-07-24  Jakub Jelinek  <jakub@redhat.com>

	* 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.
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;