[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 10/26] tcg: Avoid using hardcoded /tmp
From: |
Alex Bennée |
Subject: |
[PATCH v3 10/26] tcg: Avoid using hardcoded /tmp |
Date: |
Thu, 20 Oct 2022 12:51:53 +0100 |
From: Bin Meng <bin.meng@windriver.com>
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>
Message-Id: <20221006151927.2079583-3-bmeng.cn@gmail.com>
---
tcg/tcg.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/tcg/tcg.c b/tcg/tcg.c
index 612a12f58f..84921b64f7 100644
--- a/tcg/tcg.c
+++ b/tcg/tcg.c
@@ -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. */
--
2.34.1
- [PATCH v3 00/26] testing/next (docker, avocado, s390x, MAINTAINERS), Alex Bennée, 2022/10/20
- [PATCH v3 09/26] semihosting/arm-compat-semi: Avoid using hardcoded /tmp, Alex Bennée, 2022/10/20
- [PATCH v3 07/26] tests/docker: Add flex/bison to `debian-hexagon-cross`, Alex Bennée, 2022/10/20
- [PATCH v3 10/26] tcg: Avoid using hardcoded /tmp,
Alex Bennée <=
- [PATCH v3 02/26] tests/docker: update test-mingw to run single build, Alex Bennée, 2022/10/20
- [PATCH v3 08/26] tests/tcg: use regular semihosting for nios2-softmmu, Alex Bennée, 2022/10/20
- [PATCH v3 13/26] fsdev/virtfs-proxy-helper: Use g_mkdir(), Alex Bennée, 2022/10/20
- [PATCH v3 06/26] tests/avocado: extend the timeout for x86_64 tcg tests, Alex Bennée, 2022/10/20