Skip to content

Commit

Permalink
tcg: Avoid using hardcoded /tmp
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
lbmeng authored and stsquad committed Oct 31, 2022
1 parent 3878d0c commit eb6b2ed
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tcg/tcg.c
Expand Up @@ -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. */
Expand Down

0 comments on commit eb6b2ed

Please sign in to comment.