[libvirt PATCH 3/5] apparmor: report error when removing profile failed

Ján Tomko posted 5 patches 3 years, 8 months ago
[libvirt PATCH 3/5] apparmor: report error when removing profile failed
Posted by Ján Tomko 3 years, 8 months ago
Assign the return value to 'rc' before comparing it.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
---
 src/security/virt-aa-helper.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/security/virt-aa-helper.c b/src/security/virt-aa-helper.c
index 1f1cce8b3d..5dc941f79a 100644
--- a/src/security/virt-aa-helper.c
+++ b/src/security/virt-aa-helper.c
@@ -1497,7 +1497,7 @@ main(int argc, char **argv)
                 size = virFileLength(profile, -1);
                 if (size == 0) {
                         vah_warning(_("Profile of 0 size detected, will attempt to remove it"));
-                        if ((rc = parserRemove(ctl->uuid) != 0))
+                        if ((rc = parserRemove(ctl->uuid)) != 0)
                                 vah_error(ctl, 1, _("could not remove profile"));
                         unlink(profile);
                         purged = true;
-- 
2.34.1