On all native Windows platforms, we have this test failure:

  test-fsync.c:73: assertion failed
  FAIL: test-fsync.exe

This fixes it.


2012-02-04  Bruno Haible  <br...@clisp.org>

        fsync: Avoid test failure on native Windows.
        * lib/fsync.c (fsync) [Windows]: Don't fail if the handle is merely
        read-only.

--- lib/fsync.c.orig    Sat Feb  4 14:58:07 2012
+++ lib/fsync.c Sat Feb  4 13:15:27 2012
@@ -57,6 +57,11 @@
       err = GetLastError ();
       switch (err)
         {
+        case ERROR_ACCESS_DENIED:
+          /* For a read-only handle, fsync should succeed, even though we have
+             no way to sync the access-time changes.  */
+          return 0;
+
           /* eg. Trying to fsync a tty. */
         case ERROR_INVALID_HANDLE:
           errno = EINVAL;


Reply via email to