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

Ján Tomko posted 7 patches 6 years ago
[libvirt PATCH 1/7] testutils: check return value of g_setenv
Posted by Ján Tomko 6 years ago
The function returns gboolean.
Compare against the FALSE value from GLib.

Signed-off-by: Ján Tomko <jtomko@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

Re: [libvirt PATCH 1/7] testutils: check return value of g_setenv
Posted by Daniel P. Berrangé 5 years, 12 months ago
On Sun, Feb 09, 2020 at 02:32:31AM +0100, Ján Tomko wrote:
> The function returns gboolean.
> Compare against the FALSE value from GLib.
> 
> Signed-off-by: Ján Tomko <jtomko@redhat.com>
> Fixes: 2c3353242337bb50fe5abc9454fd5fc98236d4ef
> ---
>  tests/testutils.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>


Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|