diff options
author | Bin Meng <bin.meng@windriver.com> | 2022-08-24 17:39:39 +0800 |
---|---|---|
committer | Thomas Huth <thuth@redhat.com> | 2022-08-25 15:16:13 +0200 |
commit | a47ea61de593a8243a66caba9d436040ecae25d5 (patch) | |
tree | 8a7983c569871c1a78b89e49797c7ed217396791 /tests/qtest | |
parent | 9a99f964b152f8095949bbddca7841744ad418da (diff) |
tests/qtest: Use g_setenv()
Windows does not provide a setenv() API, but glib does.
Replace setenv() call with the glib version.
Signed-off-by: Bin Meng <bin.meng@windriver.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Message-Id: <20220824094029.1634519-2-bmeng.cn@gmail.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
Diffstat (limited to 'tests/qtest')
-rw-r--r-- | tests/qtest/fuzz/generic_fuzz.c | 8 | ||||
-rw-r--r-- | tests/qtest/libqtest.c | 2 |
2 files changed, 5 insertions, 5 deletions
diff --git a/tests/qtest/fuzz/generic_fuzz.c b/tests/qtest/fuzz/generic_fuzz.c index 447ffe8178..afc1d20355 100644 --- a/tests/qtest/fuzz/generic_fuzz.c +++ b/tests/qtest/fuzz/generic_fuzz.c @@ -994,16 +994,16 @@ static GString *generic_fuzz_predefined_config_cmdline(FuzzTarget *t) g_assert(t->opaque); config = t->opaque; - setenv("QEMU_AVOID_DOUBLE_FETCH", "1", 1); + g_setenv("QEMU_AVOID_DOUBLE_FETCH", "1", 1); if (config->argfunc) { args = config->argfunc(); - setenv("QEMU_FUZZ_ARGS", args, 1); + g_setenv("QEMU_FUZZ_ARGS", args, 1); g_free(args); } else { g_assert_nonnull(config->args); - setenv("QEMU_FUZZ_ARGS", config->args, 1); + g_setenv("QEMU_FUZZ_ARGS", config->args, 1); } - setenv("QEMU_FUZZ_OBJECTS", config->objects, 1); + g_setenv("QEMU_FUZZ_OBJECTS", config->objects, 1); return generic_fuzz_cmdline(t); } diff --git a/tests/qtest/libqtest.c b/tests/qtest/libqtest.c index 8c159eacf5..ad6860d774 100644 --- a/tests/qtest/libqtest.c +++ b/tests/qtest/libqtest.c @@ -1424,7 +1424,7 @@ QTestState *qtest_inproc_init(QTestState **s, bool log, const char* arch, * way, qtest_get_arch works for inproc qtest. */ gchar *bin_path = g_strconcat("/qemu-system-", arch, NULL); - setenv("QTEST_QEMU_BINARY", bin_path, 0); + g_setenv("QTEST_QEMU_BINARY", bin_path, 0); g_free(bin_path); return qts; |