[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 04/51] semihosting/arm-compat-semi: Avoid using hardcoded /tmp
From: |
Bin Meng |
Subject: |
[PATCH 04/51] semihosting/arm-compat-semi: Avoid using hardcoded /tmp |
Date: |
Wed, 24 Aug 2022 17:39:42 +0800 |
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>
---
semihosting/arm-compat-semi.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/semihosting/arm-compat-semi.c b/semihosting/arm-compat-semi.c
index e741674238..d5e66cc298 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;
--
2.34.1
- [PATCH 00/51] tests/qtest: Enable running qtest on Windows, Bin Meng, 2022/08/24
- [PATCH 01/51] tests/qtest: Use g_setenv(), Bin Meng, 2022/08/24
- [PATCH 02/51] tests/qtest: Use g_mkdtemp(), Bin Meng, 2022/08/24
- [PATCH 03/51] block: Unify the get_tmp_filename() implementation, Bin Meng, 2022/08/24
- [PATCH 04/51] semihosting/arm-compat-semi: Avoid using hardcoded /tmp,
Bin Meng <=
- [PATCH 05/51] tcg: Avoid using hardcoded /tmp, Bin Meng, 2022/08/24
- [PATCH 06/51] util/qemu-sockets: Use g_get_tmp_dir() to get the directory for temporary files, Bin Meng, 2022/08/24
- [PATCH 09/51] fsdev/virtfs-proxy-helper: Use g_mkdir_with_parents(), Bin Meng, 2022/08/24