sync: support syncing files on cygwin

* 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.
This commit is contained in:
Pádraig Brady committed 2022-04-13 00:36:25 +01:00
1 parent 4f920e93ec
commit 6e9bf0765f
1 file changed
+2 -2
+2 -2
View 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