summaryrefslogtreecommitdiff
path: root/src/apk.c
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2015-03-10 13:04:14 +0200
committerTimo Teräs <timo.teras@iki.fi>2015-03-10 13:15:31 +0200
commit2a6896b2b4809849441756046ee7d8ad34abab34 (patch)
treee42c99fc0a6bb2fa35fcce241776d9208a8c0471 /src/apk.c
parent417755cb2e16dee1cb674cbe2b2942c156e0b5da (diff)
downloadapk-tools-2a6896b2b4809849441756046ee7d8ad34abab34.tar.gz
apk-tools-2a6896b2b4809849441756046ee7d8ad34abab34.tar.bz2
apk-tools-2a6896b2b4809849441756046ee7d8ad34abab34.tar.xz
apk-tools-2a6896b2b4809849441756046ee7d8ad34abab34.zip
rework error handling for read streams
Diffstat (limited to 'src/apk.c')
-rw-r--r--src/apk.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/apk.c b/src/apk.c
index 17b8b69..8632587 100644
--- a/src/apk.c
+++ b/src/apk.c
@@ -524,7 +524,7 @@ int main(int argc, char **argv)
}
if (test_installed_db != NULL) {
struct apk_bstream *bs = apk_bstream_from_file(AT_FDCWD, test_installed_db);
- if (bs != NULL) {
+ if (!IS_ERR_OR_NULL(bs)) {
apk_db_index_read(&db, bs, -1);
bs->close(bs, NULL);
}
@@ -548,7 +548,7 @@ int main(int argc, char **argv)
}
bs = apk_bstream_from_file(AT_FDCWD, name.ptr);
- if (bs == NULL) {
+ if (IS_ERR_OR_NULL(bs)) {
apk_error("Failed to open repository: " BLOB_FMT, BLOB_PRINTF(name));
goto err;
}