aboutsummaryrefslogtreecommitdiff
path: root/tests/vhost-user-bridge.c
diff options
context:
space:
mode:
authorBin Meng <bin.meng@windriver.com>2022-09-25 19:30:02 +0800
committerThomas Huth <thuth@redhat.com>2022-09-27 20:51:20 +0200
commit786e46ee68d7920d4bead184c42950a4b0e2e75a (patch)
treefb0c6254bebed01929822799e04189cf8ff6f453 /tests/vhost-user-bridge.c
parent5b9f2781c251aa0b98cf9a3b025b803a7e23e638 (diff)
tests: vhost-user-bridge: Avoid using hardcoded /tmp
This case was written to use hardcoded /tmp directory for temporary files. Update to use g_file_open_tmp() 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-25-bmeng.cn@gmail.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
Diffstat (limited to 'tests/vhost-user-bridge.c')
-rw-r--r--tests/vhost-user-bridge.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/tests/vhost-user-bridge.c b/tests/vhost-user-bridge.c
index 9b1dab2f28..fecdf915e7 100644
--- a/tests/vhost-user-bridge.c
+++ b/tests/vhost-user-bridge.c
@@ -631,7 +631,6 @@ static void *notifier_thread(void *arg)
static void
vubr_host_notifier_setup(VubrDev *dev)
{
- char template[] = "/tmp/vubr-XXXXXX";
pthread_t thread;
size_t length;
void *addr;
@@ -639,7 +638,7 @@ vubr_host_notifier_setup(VubrDev *dev)
length = qemu_real_host_page_size() * VHOST_USER_BRIDGE_MAX_QUEUES;
- fd = mkstemp(template);
+ fd = g_file_open_tmp("vubr-XXXXXX", NULL, NULL);
if (fd < 0) {
vubr_die("mkstemp()");
}