summaryrefslogtreecommitdiff
path: root/src/gunzip.c
diff options
context:
space:
mode:
authorTimo Teras <timo.teras@iki.fi>2009-07-21 13:49:35 +0300
committerTimo Teras <timo.teras@iki.fi>2009-07-21 13:49:35 +0300
commit84e3786e05bb8cda52548b8d98efe87f2a1b64ac (patch)
tree56d453d243f809e8daac40b932c097fa04cc8aa2 /src/gunzip.c
parentbe8b59dbe1525a5885bbe3737aa696a01004d633 (diff)
downloadapk-tools-84e3786e05bb8cda52548b8d98efe87f2a1b64ac.tar.gz
apk-tools-84e3786e05bb8cda52548b8d98efe87f2a1b64ac.tar.bz2
apk-tools-84e3786e05bb8cda52548b8d98efe87f2a1b64ac.tar.xz
apk-tools-84e3786e05bb8cda52548b8d98efe87f2a1b64ac.zip
db: fixes to package checksumming while installing it
Diffstat (limited to 'src/gunzip.c')
-rw-r--r--src/gunzip.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/gunzip.c b/src/gunzip.c
index 2b30d46..3f9a253 100644
--- a/src/gunzip.c
+++ b/src/gunzip.c
@@ -62,9 +62,16 @@ static size_t gzi_read(void *stream, void *ptr, size_t size)
gis->z_err = Z_DATA_ERROR;
return size - gis->zs.avail_out;
} else if (gis->zs.avail_in == 0) {
- if (gis->cb != NULL)
- gis->cb(gis->cbctx, APK_MPART_END,
- APK_BLOB_NULL);
+ if (gis->cb != NULL) {
+ r = gis->cb(gis->cbctx, APK_MPART_END,
+ APK_BLOB_NULL);
+ if (r != 0) {
+ gis->z_err = Z_STREAM_END;
+ if (r > 0)
+ r = -1;
+ return r;
+ }
+ }
gis->z_err = Z_STREAM_END;
return size - gis->zs.avail_out;
}