From: Bruno Haible <bruno@clisp.org>
Date: Thu, 12 Dec 2019 01:52:11 +0000 (+0100)
Subject: fsync tests: Skip test that is known to fail.
X-Git-Tag: v1.0~4521
X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=8de83b9d8f871cd283ca4853e592290a82955fcb;p=gnulib.git

fsync tests: Skip test that is known to fail.

* doc/posix-functions/fsync.texi: Update list of platforms.
* tests/test-fsync.c (main): Skip test with read-only file descriptors
that is known to fail on AIX and Cygwin.
---

diff --git a/ChangeLog b/ChangeLog
index 326c446e77..ab6859e5fb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2019-12-11  Bruno Haible  <bruno@clisp.org>
+
+	fsync tests: Skip test that is known to fail.
+	* doc/posix-functions/fsync.texi: Update list of platforms.
+	* tests/test-fsync.c (main): Skip test with read-only file descriptors
+	that is known to fail on AIX and Cygwin.
+
 2019-12-11  Bruno Haible  <bruno@clisp.org>
 
 	getaddrinfo: Fix calling convention in 32-bit mode on native Windows.
diff --git a/doc/posix-functions/fsync.texi b/doc/posix-functions/fsync.texi
index 3328af7c0a..24305db340 100644
--- a/doc/posix-functions/fsync.texi
+++ b/doc/posix-functions/fsync.texi
@@ -18,5 +18,5 @@ Portability problems not fixed by Gnulib:
 @item
 If the argument is a read-only file descriptor, this function fails
 with @code{EBADF} on some platforms:
-AIX 7.1.
+AIX 7.2, Cygwin 2.9.
 @end itemize
diff --git a/tests/test-fsync.c b/tests/test-fsync.c
index d613cf018d..b7b5cba2d0 100644
--- a/tests/test-fsync.c
+++ b/tests/test-fsync.c
@@ -64,7 +64,9 @@ main (void)
   ASSERT (close (fd) == 0);
 
   /* For a read-only regular file input file descriptor, fsync should
-     succeed (since at least atime changes can be synchronized).  */
+     succeed (since at least atime changes can be synchronized).
+     On AIX and Cygwin, this test would fail.  */
+#if !(defined _AIX || defined __CYGWIN__)
   fd = open (file, O_RDONLY);
   ASSERT (0 <= fd);
   {
@@ -73,6 +75,7 @@ main (void)
   }
   ASSERT (fsync (fd) == 0);
   ASSERT (close (fd) == 0);
+#endif
 
   ASSERT (unlink (file) == 0);