summaryrefslogtreecommitdiff
path: root/prism/util/pm_string.c
diff options
context:
space:
mode:
authorKevin Newton <[email protected]>2024-09-11 10:42:08 -0400
committergit <[email protected]>2024-09-11 15:39:22 +0000
commit886fc69b1cfb20141608eb1f461b93e5a5464cf9 (patch)
tree6be13d13596c945d53fbbd5e4fa853ee58c7bb46 /prism/util/pm_string.c
parent7facf2323206e244b53d3771a857a8f677d2ab3e (diff)
[ruby/prism] Parse tempfile
https://github.com/ruby/prism/commit/31154a389a
Diffstat (limited to 'prism/util/pm_string.c')
-rw-r--r--prism/util/pm_string.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/prism/util/pm_string.c b/prism/util/pm_string.c
index 0a67accd86..4bd3dd8ef2 100644
--- a/prism/util/pm_string.c
+++ b/prism/util/pm_string.c
@@ -62,7 +62,7 @@ PRISM_EXPORTED_FUNCTION bool
pm_string_mapped_init(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;
@@ -156,7 +156,7 @@ PRISM_EXPORTED_FUNCTION bool
pm_string_file_init(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;