From d4af38ec9d808da3e2f3ba97477332bc96b258b9 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Wed, 11 Sep 2024 12:42:31 -0400 Subject: [PATCH] Fix FILE_SHARE_* permissions for Windows in read_entire_file --- prism_compile.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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;