fsync test: Avoid test failure on MacOS X and AIX.
authorBruno Haible <bruno@clisp.org>
Sun, 19 Jun 2011 01:13:17 +0000 (03:13 +0200)
committerBruno Haible <bruno@clisp.org>
Sun, 19 Jun 2011 01:13:17 +0000 (03:13 +0200)
* tests/test-fsync.c (fsync): Allow ENOTSUP and EBADF instead of
EINVAL.

ChangeLog
tests/test-fsync.c

index ef9564b9de3b1e9b14210d58fe0786dca2be2165..41bd84a43dea1d6f96dbc4ef8576dcf9bd6e3d08 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2011-06-18  Bruno Haible  <bruno@clisp.org>
+
+       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  <bruno@clisp.org>
 
        openat, fdopendir tests: Fix link errors.
index 84b3a7075868a4c81c23c79d9cc4916474d4469c..2627d0cba4e5b7b53d0360b3eef8cb2107f042d4 100644 (file)
@@ -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);