diff options
author | Pino Toscano <toscano.pino@tiscali.it> | 2012-09-28 18:35:43 +0200 |
---|---|---|
committer | Pino Toscano <toscano.pino@tiscali.it> | 2012-09-28 18:35:43 +0200 |
commit | b31606c0e1d9f04e2498b7c8262f7de87daa7ce7 (patch) | |
tree | fe0de7f60bd266f727c84f5570d5017efb7f9aad /sysdeps | |
parent | 115411772b189e9e41a97618816edd66f0a9a620 (diff) | |
download | glibc-b31606c0e1d9f04e2498b7c8262f7de87daa7ce7.tar.gz glibc-b31606c0e1d9f04e2498b7c8262f7de87daa7ce7.tar.xz glibc-b31606c0e1d9f04e2498b7c8262f7de87daa7ce7.zip |
aio_fsync: fix the access mode check
Make use of O_ACCMODE and O_RDONLY instead of assuming details of the O_* flags.
Diffstat (limited to 'sysdeps')
-rw-r--r-- | sysdeps/pthread/aio_fsync.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sysdeps/pthread/aio_fsync.c b/sysdeps/pthread/aio_fsync.c index 046e25c171..5b5d1863e7 100644 --- a/sysdeps/pthread/aio_fsync.c +++ b/sysdeps/pthread/aio_fsync.c @@ -46,7 +46,7 @@ aio_fsync (int op, struct aiocb *aiocbp) flags = fcntl (aiocbp->aio_fildes, F_GETFL); if (__builtin_expect (flags == -1, 0) - || __builtin_expect ((flags & (O_RDWR | O_WRONLY)) == 0, 0)) + || __builtin_expect ((flags & O_ACCMODE) == O_RDONLY, 0)) { __set_errno (EBADF); return -1; |