From cfafc6fd962bfb7fd9fa10dc3891648e818d196d Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Thu, 5 Aug 1999 00:21:21 +0000 Subject: Update. * rt/aio_fsync.c: Test OP parameter for correct values. --- ChangeLog | 2 ++ rt/aio_fsync.c | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/ChangeLog b/ChangeLog index ba82759f18..8b1c59004a 100644 --- 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 * sysdeps/unix/sysv/linux/alpha/getsysstats.c (GET_NPROCS_PARSER): 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 /* And undo the hack. */ #undef aio_fsync64 +#include #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); -- cgit v1.2.3