diff options
author | Timo Teräs <timo.teras@iki.fi> | 2021-07-17 17:57:07 +0300 |
---|---|---|
committer | Timo Teräs <timo.teras@iki.fi> | 2021-07-22 15:30:08 +0300 |
commit | 796d29831360c55d8b8b7d9aa5f33c817094c1bf (patch) | |
tree | ddb51a2c60ece9f79b48b05c1d2845ef1ba4509e /src/adb_comp.c | |
parent | b559a81694d8a95ac786104516aebf98d04b84bc (diff) | |
download | apk-tools-796d29831360c55d8b8b7d9aa5f33c817094c1bf.tar.gz apk-tools-796d29831360c55d8b8b7d9aa5f33c817094c1bf.tar.bz2 apk-tools-796d29831360c55d8b8b7d9aa5f33c817094c1bf.tar.xz apk-tools-796d29831360c55d8b8b7d9aa5f33c817094c1bf.zip |
rework apk_istream_splice and apk_istream_tee
- apk_istream_splice usage is converted to apk_stream_copy which
is the newer variant. With caching enabled by default, this
makes more sense mmapping or using separate buffers.
- apk_istream_tee is reworked to write to apk_ostream, which simplifies
quite a bit of various things
Diffstat (limited to 'src/adb_comp.c')
-rw-r--r-- | src/adb_comp.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/src/adb_comp.c b/src/adb_comp.c index d1f5bb2..9f339b8 100644 --- a/src/adb_comp.c +++ b/src/adb_comp.c @@ -26,10 +26,7 @@ struct apk_istream *adb_decompress(struct apk_istream *is, adb_comp_t *compressi is = apk_istream_deflate(is); break; } - if (c == -1) { - apk_istream_close(is); - return ERR_PTR(-APKE_ADB_COMPRESSION); - } + if (c == -1) return ERR_PTR(apk_istream_close_error(is, -APKE_ADB_COMPRESSION)); if (compression) *compression = c; return is; } |