forked from git-for-windows/MSYS2-packages
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
msys2-runtime: backport follow-up fix for offline files
This integrates msys2/msys2-runtime#210 into MSYS2-packages. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
- Loading branch information
Showing
2 changed files
with
58 additions
and
4 deletions.
There are no files selected for viewing
51 changes: 51 additions & 0 deletions
51
msys2-runtime/0054-Cygwin-FILE_OPEN_NO_RECALL-is-incompatible-with-FILE.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
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)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters