summaryrefslogtreecommitdiff
path: root/prism_compile.c
diff options
context:
space:
mode:
authorKevin Newton <[email protected]>2024-09-11 12:42:31 -0400
committerKevin Newton <[email protected]>2024-09-12 13:43:04 -0400
commitd4af38ec9d808da3e2f3ba97477332bc96b258b9 (patch)
tree98dd3144ab2a68cd7d458e7ff58ce1c18cc2e9c6 /prism_compile.c
parentd5232fd7aee45d1dba3d07cdbf29389207e5ef6c (diff)
Fix FILE_SHARE_* permissions for Windows in read_entire_file
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/11497
Diffstat (limited to 'prism_compile.c')
-rw-r--r--prism_compile.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/prism_compile.c b/prism_compile.c
index 1d0bd7933f..4c115b7766 100644
--- a/prism_compile.c
+++ b/prism_compile.c
@@ -10558,7 +10558,7 @@ read_entire_file(pm_string_t *string, const char *filepath)
{
#ifdef _WIN32
// Open the file for reading.
- HANDLE file = CreateFile(filepath, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
+ HANDLE file = CreateFile(filepath, GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_READONLY, NULL);
if (file == INVALID_HANDLE_VALUE) {
return false;