From e250cdd49b74828c25e98efa313954a395160180 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sun, 19 Jun 2011 03:13:17 +0200 Subject: [PATCH] fsync test: Avoid test failure on MacOS X and AIX. * tests/test-fsync.c (fsync): Allow ENOTSUP and EBADF instead of EINVAL. --- ChangeLog | 6 ++++++ tests/test-fsync.c | 7 ++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index ef9564b9d..41bd84a43 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,11 @@ 2011-06-18 Bruno Haible + fsync test: Avoid test failure on MacOS X and AIX. + * tests/test-fsync.c (fsync): Allow ENOTSUP and EBADF instead of + EINVAL. + +2011-06-18 Bruno Haible + openat, fdopendir tests: Fix link errors. * modules/openat-tests (Depends-on): Add progname. * modules/fdopendir-tests (Depends-on): Likewise. diff --git a/tests/test-fsync.c b/tests/test-fsync.c index 84b3a7075..2627d0cba 100644 --- a/tests/test-fsync.c +++ b/tests/test-fsync.c @@ -33,7 +33,12 @@ main (void) const char *file = "test-fsync.txt"; if (fsync (0) != 0) - ASSERT (errno == EINVAL); + { + ASSERT (errno == EINVAL /* POSIX */ + || errno == ENOTSUP /* seen on MacOS X 10.5 */ + || errno == EBADF /* seen on AIX 7.1 */ + ); + } fd = open (file, O_WRONLY|O_CREAT|O_TRUNC, 0644); ASSERT (0 <= fd); ASSERT (write (fd, "hello", 5) == 5); -- 2.11.0