summary refs log tree commit diff
path: root/rt
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>1999-08-05 00:21:21 +0000
committerUlrich Drepper <drepper@redhat.com>1999-08-05 00:21:21 +0000
commitcfafc6fd962bfb7fd9fa10dc3891648e818d196d (patch)
tree8dcd478b179baa868d091d7f7a6274bd792f1a4b /rt
parentd65ddb3495d5a35e1b00ec6fde71d6f0475264be (diff)
downloadglibc-cfafc6fd962bfb7fd9fa10dc3891648e818d196d.tar.gz
glibc-cfafc6fd962bfb7fd9fa10dc3891648e818d196d.tar.xz
glibc-cfafc6fd962bfb7fd9fa10dc3891648e818d196d.zip
Update.
	* rt/aio_fsync.c: Test OP parameter for correct values.
Diffstat (limited to 'rt')
-rw-r--r--rt/aio_fsync.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/rt/aio_fsync.c b/rt/aio_fsync.c
index 72d4837b38..298b4ec87d 100644
--- a/rt/aio_fsync.c
+++ b/rt/aio_fsync.c
@@ -28,6 +28,7 @@
 #include <aio.h>
 /* And undo the hack.  */
 #undef aio_fsync64
+#include <errno.h>
 
 #include "aio_misc.h"
 
@@ -35,6 +36,12 @@
 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);