Signed-off-by: Pavel Hrdina <phrdina(a)redhat.com>
---
src/util/virsystemd.c | 4 ++--
src/vbox/vbox_XPCOMCGlue.c | 2 +-
tests/qemusecuritytest.c | 2 +-
tests/qemuxml2argvtest.c | 10 +++++-----
tests/testutils.c | 2 +-
tests/testutilsqemu.c | 2 +-
tests/vircgrouptest.c | 8 ++++----
tests/virfiletest.c | 2 +-
tests/virsystemdtest.c | 28 ++++++++++++++--------------
9 files changed, 30 insertions(+), 30 deletions(-)
diff --git a/src/util/virsystemd.c b/src/util/virsystemd.c
index 1f9eddf70b..cfa499e5c4 100644
--- a/src/util/virsystemd.c
+++ b/src/util/virsystemd.c
@@ -854,8 +854,8 @@ virSystemdGetListenFDs(void)
return 0;
}
- unsetenv("LISTEN_PID");
- unsetenv("LISTEN_FDS");
+ g_unsetenv("LISTEN_PID");
+ g_unsetenv("LISTEN_FDS");
VIR_DEBUG("Got %u file descriptors", nfds);
diff --git a/src/vbox/vbox_XPCOMCGlue.c b/src/vbox/vbox_XPCOMCGlue.c
index 9cd39df0d8..4151d20909 100644
--- a/src/vbox/vbox_XPCOMCGlue.c
+++ b/src/vbox/vbox_XPCOMCGlue.c
@@ -106,7 +106,7 @@ tryLoadOne(const char *dir, bool setAppHome, bool ignoreMissing,
if (dir != NULL) {
g_setenv("VBOX_APP_HOME", dir, 1 /* always override */);
} else {
- unsetenv("VBOX_APP_HOME");
+ g_unsetenv("VBOX_APP_HOME");
}
}
diff --git a/tests/qemusecuritytest.c b/tests/qemusecuritytest.c
index 71719241c3..e9af92ee23 100644
--- a/tests/qemusecuritytest.c
+++ b/tests/qemusecuritytest.c
@@ -125,7 +125,7 @@ testDomain(const void *opaque)
ret = 0;
cleanup:
- unsetenv(ENVVAR);
+ g_unsetenv(ENVVAR);
freePaths();
return ret;
}
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
index 62fd95b97d..19e8842f84 100644
--- a/tests/qemuxml2argvtest.c
+++ b/tests/qemuxml2argvtest.c
@@ -797,11 +797,11 @@ mymain(void)
g_setenv("USER", "test", 1);
g_setenv("LOGNAME", "test", 1);
g_setenv("HOME", "/home/test", 1);
- unsetenv("TMPDIR");
- unsetenv("LD_PRELOAD");
- unsetenv("LD_LIBRARY_PATH");
- unsetenv("QEMU_AUDIO_DRV");
- unsetenv("SDL_AUDIODRIVER");
+ g_unsetenv("TMPDIR");
+ g_unsetenv("LD_PRELOAD");
+ g_unsetenv("LD_LIBRARY_PATH");
+ g_unsetenv("QEMU_AUDIO_DRV");
+ g_unsetenv("SDL_AUDIODRIVER");
DO_TEST("minimal", NONE);
DO_TEST("minimal-sandbox",
diff --git a/tests/testutils.c b/tests/testutils.c
index 3c786b3e29..cc951f6b29 100644
--- a/tests/testutils.c
+++ b/tests/testutils.c
@@ -148,7 +148,7 @@ virTestRun(const char *title,
fprintf(stderr, "!");
}
- unsetenv("VIR_TEST_MOCK_TESTNAME");
+ g_unsetenv("VIR_TEST_MOCK_TESTNAME");
return ret;
}
diff --git a/tests/testutilsqemu.c b/tests/testutilsqemu.c
index 081ed331fa..3799a8e5b9 100644
--- a/tests/testutilsqemu.c
+++ b/tests/testutilsqemu.c
@@ -599,7 +599,7 @@ qemuTestSetHostCPU(virCapsPtr caps,
cpu = cpuPower8;
}
- unsetenv("VIR_TEST_MOCK_FAKE_HOST_CPU");
+ g_unsetenv("VIR_TEST_MOCK_FAKE_HOST_CPU");
if (cpu) {
caps->host.arch = cpu->arch;
if (cpu->model)
diff --git a/tests/vircgrouptest.c b/tests/vircgrouptest.c
index dfedb0b91c..67785ae954 100644
--- a/tests/vircgrouptest.c
+++ b/tests/vircgrouptest.c
@@ -215,7 +215,7 @@ testCgroupDetectMounts(const void *args)
result = 0;
cleanup:
- unsetenv("VIR_CGROUP_MOCK_FILENAME");
+ g_unsetenv("VIR_CGROUP_MOCK_FILENAME");
VIR_FREE(parsed);
virCgroupFree(&group);
virBufferFreeAndReset(&buf);
@@ -1012,9 +1012,9 @@ cleanupFakeFS(char *fakerootdir)
virFileDeleteTree(fakerootdir);
VIR_FREE(fakerootdir);
- unsetenv("LIBVIRT_FAKE_ROOT_DIR");
- unsetenv("VIR_CGROUP_MOCK_MODE");
- unsetenv("VIR_CGROUP_MOCK_FILENAME");
+ g_unsetenv("LIBVIRT_FAKE_ROOT_DIR");
+ g_unsetenv("VIR_CGROUP_MOCK_MODE");
+ g_unsetenv("VIR_CGROUP_MOCK_FILENAME");
}
static int
diff --git a/tests/virfiletest.c b/tests/virfiletest.c
index 70ad4ab92c..6c25674453 100644
--- a/tests/virfiletest.c
+++ b/tests/virfiletest.c
@@ -343,7 +343,7 @@ testFileIsSharedFSType(const void *opaque G_GNUC_UNUSED)
ret = 0;
cleanup:
VIR_FREE(mtabFile);
- unsetenv("LIBVIRT_MTAB");
+ g_unsetenv("LIBVIRT_MTAB");
return ret;
#endif
}
diff --git a/tests/virsystemdtest.c b/tests/virsystemdtest.c
index 3564eea50d..f3a8524914 100644
--- a/tests/virsystemdtest.c
+++ b/tests/virsystemdtest.c
@@ -246,11 +246,11 @@ static int testCreateNoSystemd(const void *opaque G_GNUC_UNUSED)
false,
0, NULL,
NULL, 0)) == 0) {
- unsetenv("FAIL_NO_SERVICE");
+ g_unsetenv("FAIL_NO_SERVICE");
fprintf(stderr, "%s", "Unexpected create machine
success\n");
return -1;
}
- unsetenv("FAIL_NO_SERVICE");
+ g_unsetenv("FAIL_NO_SERVICE");
if (rv != -2) {
fprintf(stderr, "%s", "Unexpected create machine error\n");
@@ -280,11 +280,11 @@ static int testCreateSystemdNotRunning(const void *opaque
G_GNUC_UNUSED)
false,
0, NULL,
NULL, 0)) == 0) {
- unsetenv("FAIL_NOT_REGISTERED");
+ g_unsetenv("FAIL_NOT_REGISTERED");
fprintf(stderr, "%s", "Unexpected create machine
success\n");
return -1;
}
- unsetenv("FAIL_NOT_REGISTERED");
+ g_unsetenv("FAIL_NOT_REGISTERED");
if (rv != -2) {
fprintf(stderr, "%s", "Unexpected create machine error\n");
@@ -314,11 +314,11 @@ static int testCreateBadSystemd(const void *opaque G_GNUC_UNUSED)
false,
0, NULL,
NULL, 0)) == 0) {
- unsetenv("FAIL_BAD_SERVICE");
+ g_unsetenv("FAIL_BAD_SERVICE");
fprintf(stderr, "%s", "Unexpected create machine
success\n");
return -1;
}
- unsetenv("FAIL_BAD_SERVICE");
+ g_unsetenv("FAIL_BAD_SERVICE");
if (rv != -1) {
fprintf(stderr, "%s", "Unexpected create machine error\n");
@@ -455,12 +455,12 @@ static int testPMSupportHelper(const void *opaque)
fprintf(stderr, "Unexpected result for answer '%s'\n",
results[i]);
goto error;
}
- unsetenv("RESULT_SUPPORT");
+ g_unsetenv("RESULT_SUPPORT");
}
return 0;
error:
- unsetenv("RESULT_SUPPORT");
+ g_unsetenv("RESULT_SUPPORT");
return -1;
}
@@ -473,11 +473,11 @@ static int testPMSupportHelperNoSystemd(const void *opaque)
g_setenv("FAIL_NO_SERVICE", "1", 1);
if ((rv = data->tested(&result)) == 0) {
- unsetenv("FAIL_NO_SERVICE");
+ g_unsetenv("FAIL_NO_SERVICE");
fprintf(stderr, "%s", "Unexpected canSuspend success\n");
return -1;
}
- unsetenv("FAIL_NO_SERVICE");
+ g_unsetenv("FAIL_NO_SERVICE");
if (rv != -2) {
fprintf(stderr, "%s", "Unexpected canSuspend error\n");
@@ -496,11 +496,11 @@ static int testPMSupportSystemdNotRunning(const void *opaque)
g_setenv("FAIL_NOT_REGISTERED", "1", 1);
if ((rv = data->tested(&result)) == 0) {
- unsetenv("FAIL_NOT_REGISTERED");
+ g_unsetenv("FAIL_NOT_REGISTERED");
fprintf(stderr, "%s", "Unexpected canSuspend success\n");
return -1;
}
- unsetenv("FAIL_NOT_REGISTERED");
+ g_unsetenv("FAIL_NOT_REGISTERED");
if (rv != -2) {
fprintf(stderr, "%s", "Unexpected canSuspend error\n");
@@ -573,7 +573,7 @@ testActivation(bool useNames)
if (useNames)
g_setenv("LISTEN_FDNAMES", virBufferCurrentContent(&names), 1);
else
- unsetenv("LISTEN_FDNAMES");
+ g_unsetenv("LISTEN_FDNAMES");
map[0].name = "demo-unix.socket";
map[0].family = AF_UNIX;
@@ -640,7 +640,7 @@ testActivationEmpty(const void *opaque G_GNUC_UNUSED)
{
virSystemdActivationPtr act;
- unsetenv("LISTEN_FDS");
+ g_unsetenv("LISTEN_FDS");
if (virSystemdGetActivation(NULL, 0, &act) < 0)
return -1;
--
2.23.0