diff options
author | Timo Teräs <timo.teras@iki.fi> | 2020-01-10 11:02:48 +0200 |
---|---|---|
committer | Timo Teräs <timo.teras@iki.fi> | 2020-01-11 03:44:23 +0200 |
commit | 7ca0d146ecaf2f99781653d1203bd3db7afc85ba (patch) | |
tree | 0b167bd627a174be8e0d24f2af0f3697904ad5de /src/archive.c | |
parent | 9dda2d3c21d1116077257caafa065b659ffe419b (diff) | |
download | apk-tools-7ca0d146ecaf2f99781653d1203bd3db7afc85ba.tar.gz apk-tools-7ca0d146ecaf2f99781653d1203bd3db7afc85ba.tar.bz2 apk-tools-7ca0d146ecaf2f99781653d1203bd3db7afc85ba.tar.xz apk-tools-7ca0d146ecaf2f99781653d1203bd3db7afc85ba.zip |
istream: add buffering capability
Convert all implementations to do buffering. This is in preparation
to remove bstream interface as redundant.
istream_read() will return full reads unless end-of-file. The backends
can return short reads to optimize buffering or due to other reasons
like boundary change for gz.
Diffstat (limited to 'src/archive.c')
-rw-r--r-- | src/archive.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/archive.c b/src/archive.c index db9242f..1d956f3 100644 --- a/src/archive.c +++ b/src/archive.c @@ -303,8 +303,10 @@ int apk_tar_parse(struct apk_istream *is, apk_archive_entry_parser parser, toskip += 512 - ((offset + toskip) & 511); offset += toskip; if (toskip != 0) { - if ((r = apk_istream_read(is, NULL, toskip)) != toskip) + if ((r = apk_istream_read(is, NULL, toskip)) != toskip) { + r = -EIO; goto err; + } } } |