From: Pádraig Brady Date: Tue, 12 Apr 2022 11:04:38 +0000 (+0100) Subject: sync: support syncing files on cygwin X-Git-Tag: v9.1~10 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=6e9bf0765fb8931eddfd17736cb0554192c26fad;p=thirdparty%2Fcoreutils.git 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. --- diff --git a/src/sync.c b/src/sync.c index ffb4747fa8..de6de5d001 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