prism_compile.c: Fix read_entire_file() for platforms without file mmap

Apply similar fix to https://github.com/ruby/prism/pull/2944
This commit is contained in:
Yuta Saito 2024-08-29 17:06:19 +00:00 committed by Alan Wu
parent e07f794967
commit 591a157b0f
Notes: git 2024-08-29 18:09:54 +00:00

View File

@ -10616,6 +10616,8 @@ read_entire_file(pm_string_t *string, const char *filepath)
close(fd);
*string = (pm_string_t) { .type = PM_STRING_MAPPED, .source = source, .length = size };
return true;
#else
return pm_string_file_init(string, filepath);
#endif
}