[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 06/39] util/qemu-sockets: Use g_get_tmp_dir() to get the direc
From: |
Bin Meng |
Subject: |
[PATCH v2 06/39] util/qemu-sockets: Use g_get_tmp_dir() to get the directory for temporary files |
Date: |
Tue, 20 Sep 2022 18:31:26 +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 v2 05/39] tcg: Avoid using hardcoded /tmp, (continued)
- [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, 2022/09/20
- [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 <=
- [PATCH v2 07/39] tests: Avoid using hardcoded /tmp in test cases, Bin Meng, 2022/09/20
- [PATCH v2 09/39] fsdev/virtfs-proxy-helper: Use g_mkdir(), Bin Meng, 2022/09/20
- [PATCH v2 11/39] tests/qtest: Skip running virtio-net-test cases that require socketpair() for win32, Bin Meng, 2022/09/20
- [PATCH v2 12/39] tests/qtest: Build test-filter-{mirror, redirector} cases for posix only, Bin Meng, 2022/09/20
- [PATCH v2 13/39] tests/qtest: qmp-test: Skip running test_qmp_oob for win32, Bin Meng, 2022/09/20
- [PATCH v2 15/39] tests/qtest: libqtest: Adapt global_qtest declaration for win32, Bin Meng, 2022/09/20
- [PATCH v2 16/39] tests/qtest: Use send/recv for socket communication, Bin Meng, 2022/09/20