summaryrefslogtreecommitdiff
path: root/src/gunzip.c
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2010-12-09 10:47:09 +0200
committerTimo Teräs <timo.teras@iki.fi>2010-12-09 10:47:09 +0200
commitd92df520790dffbc114cd17c4cd1d45a09c118f9 (patch)
treeec9072833a950a71782c871cb754fb4d7665d906 /src/gunzip.c
parentc9690b0e7cdb977184e9649cd1bd3688787c1fb5 (diff)
downloadapk-tools-d92df520790dffbc114cd17c4cd1d45a09c118f9.tar.gz
apk-tools-d92df520790dffbc114cd17c4cd1d45a09c118f9.tar.bz2
apk-tools-d92df520790dffbc114cd17c4cd1d45a09c118f9.tar.xz
apk-tools-d92df520790dffbc114cd17c4cd1d45a09c118f9.zip
io: enhance istream/bstreams with pipe to forked child
* prunes the child pid to avoid zombies * handles the errors so e.g. file-not-found is reported properly
Diffstat (limited to 'src/gunzip.c')
-rw-r--r--src/gunzip.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/gunzip.c b/src/gunzip.c
index dd8d248..aebaf76 100644
--- a/src/gunzip.c
+++ b/src/gunzip.c
@@ -61,8 +61,8 @@ static ssize_t gzi_read(void *stream, void *ptr, size_t size)
gis->cbprev = blob.ptr;
gis->zs.avail_in = blob.len;
gis->zs.next_in = (void *) gis->cbprev;
- if (gis->zs.avail_in < 0) {
- gis->err = -EIO;
+ if (blob.len < 0) {
+ gis->err = blob.len;
goto ret;
} else if (gis->zs.avail_in == 0) {
gis->err = 1;