[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v5 01/18] semihosting/arm-compat-semi: Avoid using hardcoded /tmp
From: |
Bin Meng |
Subject: |
[PATCH v5 01/18] semihosting/arm-compat-semi: Avoid using hardcoded /tmp |
Date: |
Thu, 6 Oct 2022 23:19:10 +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>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
---
(no changes since v1)
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 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;
--
2.34.1
- [PATCH v5 00/18] tests/qtest: Enable running qtest on Windows, Bin Meng, 2022/10/06
- [PATCH v5 05/18] block/vvfat: Unify the mkdir() call, Bin Meng, 2022/10/06
- [PATCH v5 07/18] hw/usb: dev-mtp: Use g_mkdir(), Bin Meng, 2022/10/06
- [PATCH v5 06/18] fsdev/virtfs-proxy-helper: Use g_mkdir(), Bin Meng, 2022/10/06
- [PATCH v5 08/18] accel/qtest: Support qtest accelerator for Windows, Bin Meng, 2022/10/06