core: Fix erroneous ret = TRUE
I hit a pile of: ``` Oct 04 12:44:15 icarus.verbum.local rpm-ostreed[26257]: ostree_repo_resolve_partial_checksum: assertion 'error == NULL || *error == NULL' failed ``` Which turned out to be a missing metadata object (for some reason), but this function's incorrect use of `ret = TRUE` caused the GError to have already been set. Fix this, and we change to "direct return" style which is more readable. Closes: #474 Approved by: jlebon
This commit is contained in:
parent
4852543ecc
commit
7dd28fa964
@ -851,8 +851,6 @@ find_pkg_in_ostree (OstreeRepo *repo,
|
|||||||
gboolean *out_selinux_match,
|
gboolean *out_selinux_match,
|
||||||
GError **error)
|
GError **error)
|
||||||
{
|
{
|
||||||
gboolean ret = TRUE;
|
|
||||||
|
|
||||||
*out_in_ostree = FALSE;
|
*out_in_ostree = FALSE;
|
||||||
*out_selinux_match = FALSE;
|
*out_selinux_match = FALSE;
|
||||||
|
|
||||||
@ -863,7 +861,7 @@ find_pkg_in_ostree (OstreeRepo *repo,
|
|||||||
|
|
||||||
if (!ostree_repo_resolve_rev (repo, cachebranch, TRUE,
|
if (!ostree_repo_resolve_rev (repo, cachebranch, TRUE,
|
||||||
&cached_rev, error))
|
&cached_rev, error))
|
||||||
goto out;
|
return FALSE;
|
||||||
|
|
||||||
if (cached_rev)
|
if (cached_rev)
|
||||||
{
|
{
|
||||||
@ -874,7 +872,7 @@ find_pkg_in_ostree (OstreeRepo *repo,
|
|||||||
g_autofree char *cached_rev_sel = NULL;
|
g_autofree char *cached_rev_sel = NULL;
|
||||||
if (!find_rev_with_sepolicy (repo, cached_rev, sepolicy,
|
if (!find_rev_with_sepolicy (repo, cached_rev, sepolicy,
|
||||||
TRUE, &cached_rev_sel, error))
|
TRUE, &cached_rev_sel, error))
|
||||||
goto out;
|
return FALSE;
|
||||||
|
|
||||||
if (cached_rev_sel)
|
if (cached_rev_sel)
|
||||||
*out_selinux_match = TRUE;
|
*out_selinux_match = TRUE;
|
||||||
@ -882,9 +880,7 @@ find_pkg_in_ostree (OstreeRepo *repo,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = TRUE;
|
return TRUE;
|
||||||
out:
|
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* determine of all the marked packages, which ones we'll need to download,
|
/* determine of all the marked packages, which ones we'll need to download,
|
||||||
|
Loading…
Reference in New Issue
Block a user