MSYS2-packages/msys2-runtime-3.4/0054-Cygwin-FILE_OPEN_NO_RECALL-is-incompatible-with-FILE.patch
Johannes Schindelin e6209c6301 msys2-runtime-3.4: sync with the msys2-runtime-3.4.10 branch
Looks like we haven't updated `MSYS2-packages`' `msys2-runtime-3.4`
directory in quite a while. This roll-up integrates:

- https://github.com/msys2/msys2-runtime/pull/192
- https://github.com/msys2/msys2-runtime/pull/205
- https://github.com/msys2/msys2-runtime/pull/209
- https://github.com/msys2/msys2-runtime/pull/210
- https://github.com/msys2/msys2-runtime/pull/220

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2024-07-09 09:02:03 +02:00

52 lines
2.1 KiB
Diff

From 260676cde0b49d30209387181a2371dd35ee364c Mon Sep 17 00:00:00 2001
From: Corinna Vinschen <corinna@vinschen.de>
Date: Thu, 4 Apr 2024 17:36:01 +0200
Subject: [PATCH 54/N] Cygwin: FILE_OPEN_NO_RECALL is incompatible with
FILE_DIRECTORY_FILE
If FILE_DIRECTORY_FILE is given, FILE_OPEN_NO_RECALL is not allowed,
otherwise NtCreateFile returns STATUS_INVALID_PARAMETER.
Drop FILE_OPEN_NO_RECALL where FILE_DIRECTORY_FILE is specified.
Fixes: f6b56abec186 ("Cygwin: try to avoid recalling offline files")
Reported-by: Bruce Jerrick <bmj001@gmail.com>
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
---
winsup/cygwin/fhandler/disk_file.cc | 1 -
winsup/cygwin/path.cc | 2 --
2 files changed, 3 deletions(-)
diff --git a/winsup/cygwin/fhandler/disk_file.cc b/winsup/cygwin/fhandler/disk_file.cc
index 87c14df..4df80dc 100644
--- a/winsup/cygwin/fhandler/disk_file.cc
+++ b/winsup/cygwin/fhandler/disk_file.cc
@@ -328,7 +328,6 @@ fhandler_base::fstat_by_name (struct stat *buf)
status = NtOpenFile (&dir, SYNCHRONIZE | FILE_LIST_DIRECTORY,
&attr, &io, FILE_SHARE_VALID_FLAGS,
FILE_SYNCHRONOUS_IO_NONALERT
- | FILE_OPEN_NO_RECALL
| FILE_OPEN_FOR_BACKUP_INTENT
| FILE_DIRECTORY_FILE);
if (!NT_SUCCESS (status))
diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc
index e61d370..46d1b8c 100644
--- a/winsup/cygwin/path.cc
+++ b/winsup/cygwin/path.cc
@@ -577,7 +577,6 @@ getfileattr (const char *path, bool caseinsensitive) /* path has to be always ab
status = NtOpenFile (&dir, SYNCHRONIZE | FILE_LIST_DIRECTORY,
&attr, &io, FILE_SHARE_VALID_FLAGS,
FILE_SYNCHRONOUS_IO_NONALERT
- | FILE_OPEN_NO_RECALL
| FILE_OPEN_FOR_BACKUP_INTENT
| FILE_DIRECTORY_FILE);
if (NT_SUCCESS (status))
@@ -3483,7 +3482,6 @@ restart:
status = NtOpenFile (&dir, SYNCHRONIZE | FILE_LIST_DIRECTORY,
&dattr, &io, FILE_SHARE_VALID_FLAGS,
FILE_SYNCHRONOUS_IO_NONALERT
- | FILE_OPEN_NO_RECALL
| FILE_OPEN_FOR_BACKUP_INTENT
| FILE_DIRECTORY_FILE);
if (!NT_SUCCESS (status))