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) {
|
if (saddr->path[0] || abstract) {
|
||||||
path = saddr->path;
|
path = saddr->path;
|
||||||
} else {
|
} else {
|
||||||
const char *tmpdir = getenv("TMPDIR");
|
path = pathbuf = g_strdup_printf("%s/qemu-socket-XXXXXX",
|
||||||
tmpdir = tmpdir ? tmpdir : "/tmp";
|
g_get_tmp_dir());
|
||||||
path = pathbuf = g_strdup_printf("%s/qemu-socket-XXXXXX", tmpdir);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pathlen = strlen(path);
|
pathlen = strlen(path);
|
||||||
|
Loading…
Reference in New Issue
Block a user