From d92df520790dffbc114cd17c4cd1d45a09c118f9 Mon Sep 17 00:00:00 2001 From: Timo Teräs Date: Thu, 9 Dec 2010 10:47:09 +0200 Subject: 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 --- src/gunzip.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/gunzip.c') 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; -- cgit v1.2.3-60-g2f50