From: Michael Tremer Date: Fri, 16 Feb 2018 15:39:59 +0000 (+0100) Subject: libpakfire: Make return code of pakfire_paclkage_is_cached() clearer X-Git-Tag: 0.9.28~1285^2~1117 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=cf27dd9c7f1d9a81b7248ed58434a4d7e4cc6c83;p=pakfire.git libpakfire: Make return code of pakfire_paclkage_is_cached() clearer Signed-off-by: Michael Tremer --- diff --git a/src/libpakfire/package.c b/src/libpakfire/package.c index 47b304673..9f3ea6e52 100644 --- a/src/libpakfire/package.c +++ b/src/libpakfire/package.c @@ -865,7 +865,7 @@ PAKFIRE_EXPORT int pakfire_package_is_cached(PakfirePackage pkg) { int r = pakfire_access(path, NULL, R_OK); pakfire_free(path); - return r; + return (r == 0); } PAKFIRE_EXPORT char* pakfire_package_get_cache_path(PakfirePackage pkg) { diff --git a/src/libpakfire/step.c b/src/libpakfire/step.c index 6d392b5ed..f3df4b9b9 100644 --- a/src/libpakfire/step.c +++ b/src/libpakfire/step.c @@ -207,7 +207,7 @@ PAKFIRE_EXPORT int pakfire_step_needs_download(PakfireStep step) { return false; // Return false if package is in cache. - if (pakfire_package_is_cached(step->package) == 0) + if (pakfire_package_is_cached(step->package)) return false; return true;