tests/qtest: vhost-user-blk-test: Avoid using hardcoded /tmp
This case was written to use hardcoded /tmp directory for temporary files. Update to use g_get_tmp_dir() for a portable implementation. Signed-off-by: Bin Meng <bin.meng@windriver.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20220925113032.1949844-18-bmeng.cn@gmail.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
This commit is contained in:
parent
354aeeabec
commit
c20413558a
@ -841,7 +841,8 @@ static char *create_listen_socket(int *fd)
|
||||
char *path;
|
||||
|
||||
/* No race because our pid makes the path unique */
|
||||
path = g_strdup_printf("/tmp/qtest-%d-sock.XXXXXX", getpid());
|
||||
path = g_strdup_printf("%s/qtest-%d-sock.XXXXXX",
|
||||
g_get_tmp_dir(), getpid());
|
||||
tmp_fd = mkstemp(path);
|
||||
g_assert_cmpint(tmp_fd, >=, 0);
|
||||
close(tmp_fd);
|
||||
|
Loading…
Reference in New Issue
Block a user