summary refs log tree commit diff
path: root/rt/aio_cancel.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2000-01-05 02:12:13 +0000
committerUlrich Drepper <drepper@redhat.com>2000-01-05 02:12:13 +0000
commita3bfd999946833ebfa42fd0626d98b78ee1f33e6 (patch)
treea0120abd7f9a39c97f3db049b1c17d5ab39e9dd9 /rt/aio_cancel.c
parent1d2fc9b3c59d0e83e04139ddf633731264b76ea2 (diff)
downloadglibc-a3bfd999946833ebfa42fd0626d98b78ee1f33e6.tar.gz
glibc-a3bfd999946833ebfa42fd0626d98b78ee1f33e6.tar.xz
glibc-a3bfd999946833ebfa42fd0626d98b78ee1f33e6.zip
Update.
2000-01-04  Ulrich Drepper  <drepper@cygnus.com>

	* rt/aio.h (struct aioinit): Replace one aio_reserved value with
	aio_idle_time.
	* rt/aio_misc.c: Rewrite to not automatically terminate worker threads
	after the operation is done.  Let them linger for a user-definable
	time.
	* rt/aio_cancel.c: Likewise.
	Patch by Willian M Shubert <william.m.shubert@intel.com>.

	* sysdeps/i386/i686/add_n.S: New file.
Diffstat (limited to 'rt/aio_cancel.c')
-rw-r--r--rt/aio_cancel.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/rt/aio_cancel.c b/rt/aio_cancel.c
index 8a23353b14..dcb7d5ef8d 100644
--- a/rt/aio_cancel.c
+++ b/rt/aio_cancel.c
@@ -1,5 +1,5 @@
 /* Cancel requests associated with given file descriptor.
-   Copyright (C) 1997, 1998 Free Software Foundation, Inc.
+   Copyright (C) 1997, 1998, 2000 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
 
@@ -60,12 +60,18 @@ aio_cancel (fildes, aiocbp)
 	    {
 	      last = req;
 	      req = req->next_prio;
+	      if (req == NULL)
+		{
+		  pthread_mutex_unlock (&__aio_requests_mutex);
+		  __set_errno (EINVAL);
+		  return -1;
+		}
 	    }
 
 	  /* Don't remove the entry if a thread is already working on it.  */
 	  if (req->running == allocated)
 	    result = AIO_NOTCANCELED;
-	  else
+	  else if (req->running == yes)
 	    {
 	      /* We can remove the entry.  */
 	      if (last != NULL)