On 10/04/2022 21:59, Bruno Haible wrote:
On Cygwin 2.9.0 (x86_64) there are 35 failures:
FAIL: tests/misc/sync
This seems to be the same issue we had on AIX,
where write access is needed to fsync().
Attached does that for cygwin.
cheers,
Pádraig
From 9751dd62c35753496527e00ca66756cf471540f0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?P=C3=A1draig=20Brady?= <p...@draigbrady.com>
Date: Tue, 12 Apr 2022 12:04:38 +0100
Subject: [PATCH] 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.
---
src/sync.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/sync.c b/src/sync.c
index ffb4747fa..de6de5d00 100644
--- a/src/sync.c
+++ b/src/sync.c
@@ -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
--
2.26.2