Mercurial > hg > octave-lojdl > gnulib-hg
changeset 15689:5f984aab7803
fsync tests: EBADF tests.
* tests/test-fsync.c (main): Add more tests for EBADF.
author | Bruno Haible <bruno@clisp.org> |
---|---|
date | Tue, 20 Sep 2011 22:05:29 +0200 |
parents | 0a93aea8485c |
children | 4e2c23e35de7 |
files | ChangeLog tests/test-fsync.c |
diffstat | 2 files changed, 13 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 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.
--- a/tests/test-fsync.c +++ b/tests/test-fsync.c @@ -44,9 +44,16 @@ } /* 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);