]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
sync: support syncing files on cygwin
authorPádraig Brady <P@draigBrady.com>
Tue, 12 Apr 2022 11:04:38 +0000 (12:04 +0100)
committerPádraig Brady <P@draigBrady.com>
Tue, 12 Apr 2022 23:36:25 +0000 (00:36 +0100)
* src/sync.c (sync_arg): Similarly to AIX, Cygwin 2.9.0
was seen to need write access to have permission to sync a file.

src/sync.c

index ffb4747fa81e5503bb3b1076c938e72117a05574..de6de5d001761e96a9ead567210b44957896f99d 100644 (file)
@@ -94,8 +94,8 @@ sync_arg (enum sync_mode mode, char const *file)
   int open_flags = O_RDONLY | O_NONBLOCK;
   int fd;
 
-#ifdef _AIX
-  /* AIX 7.1 fsync requires write access to file.  */
+#if defined _AIX || defined __CYGWIN__
+  /* AIX 7.1, CYGWIN 2.9.0, fsync requires write access to file.  */
   if (mode == MODE_FILE)
     open_flags = O_WRONLY | O_NONBLOCK;
 #endif