tests/qtest: generic_fuzz: Avoid using hardcoded /tmp
This case was written to use hardcoded /tmp directory for temporary files. Update to use g_dir_make_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-11-bmeng.cn@gmail.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
This commit is contained in:
parent
394bcc5bc5
commit
9e5d84037f
@ -20,8 +20,8 @@ typedef struct generic_fuzz_config {
|
||||
} generic_fuzz_config;
|
||||
|
||||
static inline gchar *generic_fuzzer_virtio_9p_args(void){
|
||||
char tmpdir[] = "/tmp/qemu-fuzz.XXXXXX";
|
||||
g_assert_nonnull(g_mkdtemp(tmpdir));
|
||||
g_autofree char *tmpdir = g_dir_make_tmp("qemu-fuzz.XXXXXX", NULL);
|
||||
g_assert_nonnull(tmpdir);
|
||||
|
||||
return g_strdup_printf("-machine q35 -nodefaults "
|
||||
"-device virtio-9p,fsdev=hshare,mount_tag=hshare "
|
||||
|
Loading…
Reference in New Issue
Block a user