diff options
author | Bin Meng <bin.meng@windriver.com> | 2022-10-27 19:36:17 +0100 |
---|---|---|
committer | Alex Bennée <alex.bennee@linaro.org> | 2022-10-31 20:37:58 +0000 |
commit | eb6b2edf8e1a5845c81f3c4da905f1f8bbc0dec3 (patch) | |
tree | a43129f283e6292aee8793c87029aeebee07f3ce /tcg | |
parent | 3878d0c7d7de9fe201513b8ee31e38e53361a97d (diff) |
tcg: Avoid using hardcoded /tmp
Use g_get_tmp_dir() to get the directory to use for temporary files.
Signed-off-by: Bin Meng <bin.meng@windriver.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-Id: <20221006151927.2079583-3-bmeng.cn@gmail.com>
Message-Id: <20221027183637.2772968-12-alex.bennee@linaro.org>
Diffstat (limited to 'tcg')
-rw-r--r-- | tcg/tcg.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -4729,7 +4729,8 @@ static void tcg_register_jit_int(const void *buf_ptr, size_t buf_size, /* Enable this block to be able to debug the ELF image file creation. One can use readelf, objdump, or other inspection utilities. */ { - FILE *f = fopen("/tmp/qemu.jit", "w+b"); + g_autofree char *jit = g_strdup_printf("%s/qemu.jit", g_get_tmp_dir()); + FILE *f = fopen(jit, "w+b"); if (f) { if (fwrite(img, img_size, 1, f) != img_size) { /* Avoid stupid unused return value warning for fwrite. */ |