apparmor: report error when removing profile failed

Assign the return value to 'rc' before comparing it.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
This commit is contained in:
Ján Tomko 2022-05-18 15:58:06 +02:00
parent ef17772900
commit 9e41a59ce5

View File

@ -1497,7 +1497,7 @@ main(int argc, char **argv)
size = virFileLength(profile, -1); size = virFileLength(profile, -1);
if (size == 0) { if (size == 0) {
vah_warning(_("Profile of 0 size detected, will attempt to remove it")); 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")); vah_error(ctl, 1, _("could not remove profile"));
unlink(profile); unlink(profile);
purged = true; purged = true;