summaryrefslogtreecommitdiff
path: root/src/database.c
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2023-04-12 12:45:57 +0300
committerTimo Teräs <timo.teras@iki.fi>2023-04-12 12:45:57 +0300
commit01821c845f355220b57719f12849428fa1f08741 (patch)
tree04c2122912e54d6c986ab28559899a44e97734f2 /src/database.c
parent6650b02529a32e3516830b2fe75750ef0c489ca7 (diff)
downloadapk-tools-01821c845f355220b57719f12849428fa1f08741.tar.gz
apk-tools-01821c845f355220b57719f12849428fa1f08741.tar.bz2
apk-tools-01821c845f355220b57719f12849428fa1f08741.tar.xz
apk-tools-01821c845f355220b57719f12849428fa1f08741.zip
db, index: clean up index writing error handling
Diffstat (limited to 'src/database.c')
-rw-r--r--src/database.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/database.c b/src/database.c
index ba53ecb..da77b07 100644
--- a/src/database.c
+++ b/src/database.c
@@ -1208,7 +1208,6 @@ static int apk_db_index_write_nr_cache(struct apk_database *db)
struct apk_package_array *pkgs;
struct apk_package **ppkg;
struct apk_ostream *os;
- int r;
if (!apk_db_cache_active(db)) return 0;
@@ -1225,8 +1224,7 @@ static int apk_db_index_write_nr_cache(struct apk_database *db)
struct apk_package *pkg = *ppkg;
if ((pkg->repos == BIT(APK_REPOSITORY_CACHED) ||
(pkg->repos == 0 && !pkg->installed_size))) {
- r = apk_pkg_write_index_entry(pkg, os);
- if (r != 0) return r;
+ if (apk_pkg_write_index_entry(pkg, os) < 0) break;
}
}
return apk_ostream_close(os);