[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 04/39] semihosting/arm-compat-semi: Avoid using hardcoded /tmp
From: |
Bin Meng |
Subject: |
[PATCH v2 04/39] semihosting/arm-compat-semi: Avoid using hardcoded /tmp |
Date: |
Tue, 20 Sep 2022 18:31:24 +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>
---
(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 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 v2 01/39] tests: Change to use g_mkdir(), (continued)
[PATCH v2 03/39] block: Unify the get_tmp_filename() implementation, Bin Meng, 2022/09/20
[PATCH v2 05/39] tcg: Avoid using hardcoded /tmp, Bin Meng, 2022/09/20
[PATCH v2 04/39] semihosting/arm-compat-semi: Avoid using hardcoded /tmp,
Bin Meng <=
[PATCH v2 08/39] block/vvfat: Unify the mkdir() call, Bin Meng, 2022/09/20
[PATCH v2 02/39] tests/qtest: i440fx-test: Rewrite create_blob_file() to be portable, Bin Meng, 2022/09/20
[PATCH v2 10/39] hw/usb: dev-mtp: Use g_mkdir(), Bin Meng, 2022/09/20
[PATCH v2 06/39] util/qemu-sockets: Use g_get_tmp_dir() to get the directory for temporary files, Bin Meng, 2022/09/20
[PATCH v2 07/39] tests: Avoid using hardcoded /tmp in test cases, Bin Meng, 2022/09/20