[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v4 04/54] util/qemu-sockets: Use g_get_tmp_dir() to get the direc
From: |
Bin Meng |
Subject: |
[PATCH v4 04/54] util/qemu-sockets: Use g_get_tmp_dir() to get the directory for temporary files |
Date: |
Tue, 27 Sep 2022 19:05:42 +0800 |
From: Bin Meng <bin.meng@windriver.com>
Replace the existing logic to get the directory for temporary files
with g_get_tmp_dir(), which works for win32 too.
Signed-off-by: Bin Meng <bin.meng@windriver.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
(no changes since v1)
util/qemu-sockets.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/util/qemu-sockets.c b/util/qemu-sockets.c
index 83f4bd6fd2..0c41ca9e42 100644
--- a/util/qemu-sockets.c
+++ b/util/qemu-sockets.c
@@ -919,9 +919,8 @@ static int unix_listen_saddr(UnixSocketAddress *saddr,
if (saddr->path[0] || abstract) {
path = saddr->path;
} else {
- const char *tmpdir = getenv("TMPDIR");
- tmpdir = tmpdir ? tmpdir : "/tmp";
- path = pathbuf = g_strdup_printf("%s/qemu-socket-XXXXXX", tmpdir);
+ path = pathbuf = g_strdup_printf("%s/qemu-socket-XXXXXX",
+ g_get_tmp_dir());
}
pathlen = strlen(path);
--
2.34.1
- [PATCH v4 01/54] tests/qtest: i440fx-test: Rewrite create_blob_file() to be portable, (continued)
- [PATCH v4 01/54] tests/qtest: i440fx-test: Rewrite create_blob_file() to be portable, Bin Meng, 2022/09/27
- [PATCH v4 03/54] tcg: Avoid using hardcoded /tmp, Bin Meng, 2022/09/27
- [PATCH v4 02/54] semihosting/arm-compat-semi: Avoid using hardcoded /tmp, Bin Meng, 2022/09/27
- [PATCH v4 07/54] tests/qtest: boot-serial-test: Avoid using hardcoded /tmp, Bin Meng, 2022/09/27
- [PATCH v4 09/54] tests/qtest: fdc-test: Avoid using hardcoded /tmp, Bin Meng, 2022/09/27
- [PATCH v4 08/54] tests/qtest: cxl-test: Avoid using hardcoded /tmp, Bin Meng, 2022/09/27
- [PATCH v4 10/54] tests/qtest: generic_fuzz: Avoid using hardcoded /tmp, Bin Meng, 2022/09/27
- [PATCH v4 06/54] tests/qtest: aspeed_smc-test: Avoid using hardcoded /tmp, Bin Meng, 2022/09/27
- [PATCH v4 04/54] util/qemu-sockets: Use g_get_tmp_dir() to get the directory for temporary files,
Bin Meng <=
- [PATCH v4 05/54] tests/qtest: ahci-test: Avoid using hardcoded /tmp, Bin Meng, 2022/09/27
- [PATCH v4 12/54] tests/qtest: hd-geo-test: Avoid using hardcoded /tmp, Bin Meng, 2022/09/27
- [PATCH v4 14/54] tests/qtest: migration-test: Avoid using hardcoded /tmp, Bin Meng, 2022/09/27
- [PATCH v4 21/54] tests/qtest: libqtest: Avoid using hardcoded /tmp, Bin Meng, 2022/09/27
- [PATCH v4 19/54] tests/qtest: virtio-blk-test: Avoid using hardcoded /tmp, Bin Meng, 2022/09/27
- [PATCH v4 20/54] tests/qtest: virtio-scsi-test: Avoid using hardcoded /tmp, Bin Meng, 2022/09/27
- [PATCH v4 22/54] tests/unit: test-image-locking: Avoid using hardcoded /tmp, Bin Meng, 2022/09/27