[libvirt] [PATCH v4 03/25] qemusecuritymock: Actually set error on failure

Michal Privoznik posted 25 patches 6 years, 9 months ago
[libvirt] [PATCH v4 03/25] qemusecuritymock: Actually set error on failure
Posted by Michal Privoznik 6 years, 9 months ago
I don't really know what happened when I was writing the original
code, but even if error was to be set the corresponding boolean
was set to false meaning no error.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
---
 tests/qemusecuritymock.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tests/qemusecuritymock.c b/tests/qemusecuritymock.c
index 1ca8bd721f..e52a41067a 100644
--- a/tests/qemusecuritymock.c
+++ b/tests/qemusecuritymock.c
@@ -366,7 +366,7 @@ checkOwner(void *payload,
         fprintf(stderr,
                 "Path %s wasn't restored back to its original owner\n",
                 (const char *) name);
-        *chown_fail = false;
+        *chown_fail = true;
     }
 
     return 0;
@@ -382,7 +382,7 @@ printXATTR(void *payload,
 
     /* The fact that we are in this function means that there are
      * some XATTRs left behind. This is enough to claim an error. */
-    *xattr_fail = false;
+    *xattr_fail = true;
 
     /* Hash table key consists of "$path:$xattr_name", xattr
      * value is then the value stored in the hash table. */
-- 
2.21.0

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH v4 03/25] qemusecuritymock: Actually set error on failure
Posted by Daniel P. Berrangé 6 years, 7 months ago
On Thu, Apr 25, 2019 at 10:19:39AM +0200, Michal Privoznik wrote:
> I don't really know what happened when I was writing the original
> code, but even if error was to be set the corresponding boolean
> was set to false meaning no error.
> 
> Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
> ---
>  tests/qemusecuritymock.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

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 :|

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list