Created
June 13, 2017 13:18
-
-
Save akoeplinger/6aa79261f13bb8bd68deae68f3e4d9af to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/mono/mini/aot-compiler.c b/mono/mini/aot-compiler.c | |
index 3c4e3aa899f..d586e3db939 100644 | |
--- a/mono/mini/aot-compiler.c | |
+++ b/mono/mini/aot-compiler.c | |
@@ -11688,8 +11688,14 @@ mono_compile_assembly (MonoAssembly *ass, guint32 opts, const char *aot_options) | |
acfg->tmpfname = g_strdup_printf ("%s.s", acfg->image->name); | |
acfg->fp = fopen (acfg->tmpfname, "w+"); | |
} else { | |
- int i = g_file_open_tmp ("mono_aot_XXXXXX", &acfg->tmpfname, NULL); | |
- acfg->fp = fdopen (i, "w+"); | |
+ if (strcmp (acfg->aot_opts.temp_path, "") == 0) { | |
+ int i = g_file_open_tmp ("mono_aot_XXXXXX", &acfg->tmpfname, NULL); | |
+ acfg->fp = fdopen (i, "w+"); | |
+ } else { | |
+ acfg->tmpbasename = g_build_filename (acfg->aot_opts.temp_path, "temp", NULL); | |
+ acfg->tmpfname = g_strdup_printf ("%s.s", acfg->tmpbasename); | |
+ acfg->fp = fopen (acfg->tmpfname, "w+"); | |
+ } | |
} | |
if (acfg->fp == 0 && !acfg->aot_opts.llvm_only) { | |
aot_printerrf (acfg, "Unable to open file '%s': %s\n", acfg->tmpfname, strerror (errno)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment