This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [COMMITTED PATCH] BZ#15361: Make aio_fsync not check open modes.
- From: Roland McGrath <roland at hack dot frob dot com>
- To: Siddhesh Poyarekar <siddhesh dot poyarekar at gmail dot com>
- Cc: GNU C Library <libc-alpha at sourceware dot org>, Xavier Roche <roche+kml2 at exalead dot com>
- Date: Tue, 16 Apr 2013 12:12:06 -0700 (PDT)
- Subject: Re: [COMMITTED PATCH] BZ#15361: Make aio_fsync not check open modes.
- References: <513EEF07 dot 5090901 at 3ds dot com> <20130408212729 dot ED7592C085 at topped-with-meat dot com> <5163BA06 dot 30600 at exalead dot com> <20130411225058 dot 989CB2C07B at topped-with-meat dot com> <5167A305 dot 1010506 at exalead dot com> <20130412201133 dot C24782C07C at topped-with-meat dot com> <CAAHN_R2i9x+aEN+b-ZiSpXRKSsJteVHzE9BjGKVWuEvjvjVHvw at mail dot gmail dot com>
Oops. Fixed thusly.
2013-04-16 Roland McGrath <roland@hack.frob.com>
* rt/tst-aio7.c (do_test): Don't test O_RDONLY fd case, which is now
considered kosher.
--- a/rt/tst-aio7.c
+++ b/rt/tst-aio7.c
@@ -78,7 +78,7 @@ do_test (void)
puts ("aio_cancel( -1, {-2..} ) did not return -1 or errno != EBADF");
}
- /* Test for aio_fsync() detecting bad fd, and fd not open for writing. */
+ /* Test for aio_fsync() detecting bad fd. */
{
struct aiocb cb;
int fd = -1;
@@ -98,21 +98,6 @@ do_test (void)
puts ("aio_fsync( op, {-1..} ) did not return -1 or errno != EBADF");
++result;
}
-
- if ((fd = open ("/dev/null", O_RDONLY)) < 0)
- error (1, errno, "opening /dev/null");
-
- cb.aio_fildes = fd;
- errno = 0;
-
- /* Case two: valid fd but open for read only. */
- if (aio_fsync (O_SYNC, &cb) != -1 || errno != EBADF)
- {
- puts ("aio_fsync( op, {RO..} ) did not return -1 or errno != EBADF");
- ++result;
- }
-
- close (fd);
}
/* Test for aio_suspend() suspending even if completed elements in list. */