summaryrefslogtreecommitdiff
path: root/rpm2cpio.c
diff options
context:
space:
mode:
authorroot <devnull@localhost>1996-06-10 20:47:55 +0000
committerroot <devnull@localhost>1996-06-10 20:47:55 +0000
commit744f6a80afb4144c788f12a9fc5f49afcbc24ed7 (patch)
treeedfb398ddb4f9027336c29e44d929dbe97f76ef3 /rpm2cpio.c
parent83203543e52bb5b57b7f80a70a3bfcbfa6dd2d39 (diff)
downloadlibrpm-tizen-744f6a80afb4144c788f12a9fc5f49afcbc24ed7.tar.gz
librpm-tizen-744f6a80afb4144c788f12a9fc5f49afcbc24ed7.tar.bz2
librpm-tizen-744f6a80afb4144c788f12a9fc5f49afcbc24ed7.zip
more messages
CVS patchset: 637 CVS date: 1996/06/10 20:47:55
Diffstat (limited to 'rpm2cpio.c')
-rw-r--r--rpm2cpio.c22
1 files changed, 20 insertions, 2 deletions
diff --git a/rpm2cpio.c b/rpm2cpio.c
index a7cfc8f2a..cf1640bb9 100644
--- a/rpm2cpio.c
+++ b/rpm2cpio.c
@@ -8,6 +8,15 @@
#include "lib/package.h"
#include "rpmlib.h"
+char *zlib_err [] = {
+ "No",
+ "Unix",
+ "Data",
+ "Memory",
+ "Buffer",
+ "Version"
+};
+
int main(int argc, char **argv)
{
int fd;
@@ -39,9 +48,18 @@ int main(int argc, char **argv)
stream = gzdopen(fd, "r");
- while ((ct = gzread(stream, &buffer, 1024))) {
+ while ((ct = gzread(stream, &buffer, 1024)) > 0) {
write(1, &buffer, ct);
}
-
+ if (ct < 0){
+ int zerror;
+
+ gzerror (stream, &zerror);
+ if (zerror == Z_ERRNO){
+ perror ("While uncompressing");
+ return 1;
+ }
+ fprintf (stderr, "rpm2cpio: zlib: %s error\n", zlib_err [-zerror]);
+ }
return 0;
}