summaryrefslogtreecommitdiffstats
path: root/semihosting
diff options
context:
space:
mode:
authorBin Meng2022-10-27 20:36:16 +0200
committerAlex Bennée2022-10-31 21:37:58 +0100
commit3878d0c7d7de9fe201513b8ee31e38e53361a97d (patch)
treec0fc55cfd79344b5f23919b09af0a48d869a51f0 /semihosting
parenttests/tcg/nios2: Tweak 10m50-ghrd.ld (diff)
downloadqemu-3878d0c7d7de9fe201513b8ee31e38e53361a97d.tar.gz
qemu-3878d0c7d7de9fe201513b8ee31e38e53361a97d.tar.xz
qemu-3878d0c7d7de9fe201513b8ee31e38e53361a97d.zip
semihosting/arm-compat-semi: 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: 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> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-Id: <20221006151927.2079583-2-bmeng.cn@gmail.com> Message-Id: <20221027183637.2772968-11-alex.bennee@linaro.org>
Diffstat (limited to 'semihosting')
-rw-r--r--semihosting/arm-compat-semi.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/semihosting/arm-compat-semi.c b/semihosting/arm-compat-semi.c
index bfea9e9337..62d8bae97f 100644
--- a/semihosting/arm-compat-semi.c
+++ b/semihosting/arm-compat-semi.c
@@ -503,7 +503,8 @@ void do_common_semihosting(CPUState *cs)
GET_ARG(0);
GET_ARG(1);
GET_ARG(2);
- len = asprintf(&s, "/tmp/qemu-%x%02x", getpid(), (int)arg1 & 0xff);
+ len = asprintf(&s, "%s/qemu-%x%02x", g_get_tmp_dir(),
+ getpid(), (int)arg1 & 0xff);
if (len < 0) {
common_semi_set_ret(cs, -1);
break;