* tests/test-fsync.c (main): Add more tests for EBADF.
2011-09-20 Bruno Haible <bruno@clisp.org>
+ fsync tests: EBADF tests.
+ * tests/test-fsync.c (main): Add more tests for EBADF.
+
fdatasync tests: EBADF tests.
* tests/test-fdatasync.c (main): Add more tests for EBADF.
}
/* fsync must fail on invalid fd. */
- errno = 0;
- ASSERT (fsync (-1) == -1);
- ASSERT (errno == EBADF);
+ {
+ errno = 0;
+ ASSERT (fsync (-1) == -1);
+ ASSERT (errno == EBADF);
+ }
+ {
+ errno = 0;
+ ASSERT (fsync (99) == -1);
+ ASSERT (errno == EBADF);
+ }
fd = open (file, O_WRONLY|O_CREAT|O_TRUNC, 0644);
ASSERT (0 <= fd);