Skip to content

Commit d54901c

Browse files
lbmengawojasinski
authored andcommitted
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 <[email protected]> Reviewed-by: Alex Bennée <[email protected]> Signed-off-by: Alex Bennée <[email protected]> Reviewed-by: Philippe Mathieu-Daudé <[email protected]> Reviewed-by: Richard Henderson <[email protected]> Message-Id: <[email protected]> Message-Id: <[email protected]> (cherry picked from commit 3878d0c)
1 parent ea5ac06 commit d54901c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

semihosting/arm-compat-semi.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -503,7 +503,8 @@ void do_common_semihosting(CPUState *cs)
503503
GET_ARG(0);
504504
GET_ARG(1);
505505
GET_ARG(2);
506-
len = asprintf(&s, "/tmp/qemu-%x%02x", getpid(), (int)arg1 & 0xff);
506+
len = asprintf(&s, "%s/qemu-%x%02x", g_get_tmp_dir(),
507+
getpid(), (int)arg1 & 0xff);
507508
if (len < 0) {
508509
common_semi_set_ret(cs, -1);
509510
break;

0 commit comments

Comments
 (0)