diff --git a/compat/mingw.c b/compat/mingw.c index c4320769db654d..e8f491d03a7096 100644 --- a/compat/mingw.c +++ b/compat/mingw.c @@ -2273,7 +2273,7 @@ int mingw_rename(const char *pold, const char *pnew) old_handle = CreateFileW(wpold, DELETE, FILE_SHARE_WRITE | FILE_SHARE_READ | FILE_SHARE_DELETE, - NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); + NULL, OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, NULL); if (old_handle == INVALID_HANDLE_VALUE) { errno = err_win_to_posix(GetLastError()); return -1;