diff options
author | Timo Teräs <timo.teras@iki.fi> | 2015-03-10 13:04:14 +0200 |
---|---|---|
committer | Timo Teräs <timo.teras@iki.fi> | 2015-03-10 13:15:31 +0200 |
commit | 2a6896b2b4809849441756046ee7d8ad34abab34 (patch) | |
tree | e42c99fc0a6bb2fa35fcce241776d9208a8c0471 /src/package.c | |
parent | 417755cb2e16dee1cb674cbe2b2942c156e0b5da (diff) | |
download | apk-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/package.c')
-rw-r--r-- | src/package.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/package.c b/src/package.c index 71d1023..7111968 100644 --- a/src/package.c +++ b/src/package.c @@ -903,8 +903,10 @@ int apk_pkg_read(struct apk_database *db, const char *file, if (ctx.pkg == NULL) goto err; bs = apk_bstream_from_file(AT_FDCWD, file); - if (bs == NULL) + if (IS_ERR_OR_NULL(bs)) { + r = PTR_ERR(bs) ?: -EIO; goto err; + } ctx.db = db; ctx.pkg->size = fi.size; |