[libvirt PATCH 1/7] testutils: check return value of g_setenv

Ján Tomko jtomko at redhat.com
Sun Feb 9 01:32:31 UTC 2020


The function returns gboolean.
Compare against the FALSE value from GLib.

Signed-off-by: Ján Tomko <jtomko at redhat.com>
Fixes: 2c3353242337bb50fe5abc9454fd5fc98236d4ef
---
 tests/testutils.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/testutils.c b/tests/testutils.c
index 0cf0ac7e5c..83daed8940 100644
--- a/tests/testutils.c
+++ b/tests/testutils.c
@@ -836,7 +836,7 @@ virTestSetEnvPath(void)
     }
 
     if (new_path &&
-        g_setenv("PATH", new_path, TRUE) < 0)
+        g_setenv("PATH", new_path, TRUE) == FALSE)
         goto cleanup;
 
     ret = 0;
-- 
2.21.1




More information about the libvir-list mailing list