Skip to content

Commit

Permalink
semihosting/arm-compat-semi: 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 <[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]>
  • Loading branch information
lbmeng authored and stsquad committed Oct 31, 2022
1 parent 25916dd commit 3878d0c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion semihosting/arm-compat-semi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 3878d0c

Please sign in to comment.