bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

fsync on native Windows


From: Bruno Haible
Subject: fsync on native Windows
Date: Sat, 04 Feb 2012 15:01:49 +0100
User-agent: KMail/4.7.4 (Linux/3.1.0-1.2-desktop; KDE/4.7.4; x86_64; ; )

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  <address@hidden>

        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

[Prev in Thread] Current Thread [Next in Thread]