From d2671e7627e14358936c5c3b368778e16dd71292 Mon Sep 17 00:00:00 2001 From: Andrea Mazzoleni Date: Thu, 23 Oct 2025 18:22:03 +0200 Subject: [PATCH] Ensure that in Windows the content rename operation is flushed to disk --- cmdline/mingw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmdline/mingw.c b/cmdline/mingw.c index 0f5ec0fc..cf903ec4 100644 --- a/cmdline/mingw.c +++ b/cmdline/mingw.c @@ -1162,7 +1162,7 @@ int windows_rename(const char* from, const char* to) * Is an atomic file rename (with overwrite) possible on Windows? * http://stackoverflow.com/questions/167414/is-an-atomic-file-rename-with-overwrite-possible-on-windows */ - if (!MoveFileExW(convert(conv_buf_from, from), convert(conv_buf_to, to), MOVEFILE_REPLACE_EXISTING)) { + if (!MoveFileExW(convert(conv_buf_from, from), convert(conv_buf_to, to), MOVEFILE_REPLACE_EXISTING | MOVEFILE_WRITE_THROUGH)) { windows_errno(GetLastError()); return -1; }