]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Update from main line.
authorUlrich Drepper <drepper@redhat.com>
Thu, 5 Aug 1999 00:21:51 +0000 (00:21 +0000)
committerUlrich Drepper <drepper@redhat.com>
Thu, 5 Aug 1999 00:21:51 +0000 (00:21 +0000)
ChangeLog
rt/aio_fsync.c
rt/aio_misc.c
rt/aio_read.c
rt/aio_read64.c
rt/aio_write.c
rt/aio_write64.c

index 16678d62366eb4e88ba3245246502edc2aa970ec..809dc38ab109c124f3ad24d7e5cef49cec1d7c04 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -10,6 +10,8 @@
 
        * rt/aio_misc.c: Set errno at correct place.
 
+       * rt/aio_fsync.c: Test OP parameter for correct values.
+
 1999-08-04  Andreas Schwab  <schwab@suse.de>
 
        * sysdeps/unix/sysv/linux/alpha/getsysstats.c (GET_NPROCS_PARSER):
index 72d4837b38562ba27c0c93df8c354ce066ee3656..298b4ec87d335a9d9908602db41f3f50b18974c5 100644 (file)
@@ -28,6 +28,7 @@
 #include <aio.h>
 /* And undo the hack.  */
 #undef aio_fsync64
+#include <errno.h>
 
 #include "aio_misc.h"
 
 int
 aio_fsync (int op, struct aiocb *aiocbp)
 {
+  if (op != O_DSYNC && op != O_SYNC)
+    {
+      __set_errno (EINVAL);
+      return -1;
+    }
+
   return (__aio_enqueue_request ((aiocb_union *) aiocbp,
                                 op == O_SYNC ? LIO_SYNC : LIO_DSYNC) == NULL
          ? -1 : 0);
index 742a8abaf12708739436b17967a42176dc1edd6d..ba0c9d47cf35d3f7ed706fc6cf445a1fa7972893 100644 (file)
@@ -1,5 +1,5 @@
 /* Handle general operations.
-   Copyright (C) 1997, 1998 Free Software Foundation, Inc.
+   Copyright (C) 1997, 1998, 1999 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
 
@@ -260,8 +260,8 @@ __aio_enqueue_request (aiocb_union *aiocbp, int operation)
   newp = get_elem ();
   if (newp == NULL)
     {
-      __set_errno (EAGAIN);
       pthread_mutex_unlock (&__aio_requests_mutex);
+      __set_errno (EAGAIN);
       return NULL;
     }
   newp->aiocbp = aiocbp;
index 871ce99767084308d5f8f3a28af72469796ca0cf..4b5d404190102c2777fb153eb4c1c6c2004a52e2 100644 (file)
@@ -1,5 +1,5 @@
 /* Asynchronous read.
-   Copyright (C) 1997 Free Software Foundation, Inc.
+   Copyright (C) 1997, 1999 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
 
@@ -27,5 +27,6 @@ int
 aio_read (aiocbp)
      struct aiocb *aiocbp;
 {
-  return __aio_enqueue_request ((aiocb_union *) aiocbp, LIO_READ) != NULL;
+  return (__aio_enqueue_request ((aiocb_union *) aiocbp, LIO_READ) == NULL
+         ? -1 : 0);
 }
index b194dda6db90713276849f5f7f6f5a7e95be9600..0006ad6303ac63a34d79d80c8dacf25e4254691b 100644 (file)
@@ -1,5 +1,5 @@
 /* Asynchronous read, 64bit offset version.
-   Copyright (C) 1997 Free Software Foundation, Inc.
+   Copyright (C) 1997, 1999 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
 
@@ -27,5 +27,6 @@ int
 aio_read64 (aiocbp)
      struct aiocb64 *aiocbp;
 {
-  return __aio_enqueue_request ((aiocb_union *) aiocbp, LIO_READ64) != NULL;
+  return (__aio_enqueue_request ((aiocb_union *) aiocbp, LIO_READ64) == NULL
+         ? -1 : 0);
 }
index 8801d89110691520234acddfcd4d026cbd6a7ef3..77ad0a685b12a51e196f93566e5ac1159c7d3d1c 100644 (file)
@@ -1,5 +1,5 @@
 /* Asynchronous write.
-   Copyright (C) 1997 Free Software Foundation, Inc.
+   Copyright (C) 1997, 1999 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
 
@@ -27,5 +27,6 @@ int
 aio_write (aiocbp)
      struct aiocb *aiocbp;
 {
-  return __aio_enqueue_request ((aiocb_union *) aiocbp, LIO_WRITE) != NULL;
+  return (__aio_enqueue_request ((aiocb_union *) aiocbp, LIO_WRITE) == NULL
+         ? -1 : 0);
 }
index 4d599b10621685931566647905bff9747609b7e2..bc95e50b4915ba291f7fec84e32b837ca9e734cf 100644 (file)
@@ -1,5 +1,5 @@
 /* Asynchronous write, 64bit offset version.
-   Copyright (C) 1997 Free Software Foundation, Inc.
+   Copyright (C) 1997, 1999 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
 
@@ -27,5 +27,6 @@ int
 aio_write64 (aiocbp)
      struct aiocb64 *aiocbp;
 {
-  return __aio_enqueue_request ((aiocb_union *) aiocbp, LIO_WRITE64) != NULL;
+  return (__aio_enqueue_request ((aiocb_union *) aiocbp, LIO_WRITE64) == NULL
+         ? -1 : 0);
 }