mirror of
https://github.com/xemu-project/xemu.git
synced 2024-11-23 19:49:43 +00:00
util/qemu-sockets: Use g_get_tmp_dir() to get the directory for temporary files
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> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
parent
bf98afc75e
commit
926a895c2c
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user