diff options
Diffstat (limited to 'mjit.c')
-rw-r--r-- | mjit.c | 7 |
1 files changed, 3 insertions, 4 deletions
@@ -423,6 +423,7 @@ init_header_filename(void) } else #endif +#ifndef _MSC_VER { /* A name of the header file included in any C file generated by MJIT for iseqs. */ static const char header_name[] = MJIT_HEADER_INSTALL_DIR "/" MJIT_MIN_HEADER_NAME; @@ -431,9 +432,7 @@ init_header_filename(void) header_file = xmalloc(baselen + header_name_len + 1); p = append_str2(header_file, basedir, baselen); p = append_str2(p, header_name, header_name_len + 1); - } -#ifndef _MSC_VER - { + if ((fd = rb_cloexec_open(header_file, O_RDONLY, 0)) < 0) { verbose(1, "Cannot access header file: %s", header_file); xfree(header_file); @@ -451,7 +450,7 @@ init_header_filename(void) } #else { - static const char pch_name[] = MJIT_PRECOMPILED_HEADER_NAME; + static const char pch_name[] = MJIT_HEADER_INSTALL_DIR "/" MJIT_PRECOMPILED_HEADER_NAME; const size_t pch_name_len = sizeof(pch_name) - 1; pch_file = xmalloc(baselen + pch_name_len + 1); |