summaryrefslogtreecommitdiff
path: root/rpmio
diff options
context:
space:
mode:
authorJindrich Novy <jnovy@redhat.com>2008-11-26 16:35:07 +0100
committerJindrich Novy <jnovy@redhat.com>2008-11-26 16:44:53 +0100
commitd6f6d2b565f8ccb005b3230fa987a9d961c64533 (patch)
treef306cc65758c8addafe31f6195bf1166a6e22f39 /rpmio
parent2494b26f01ae7447365fd3b62d028e4402f9cff5 (diff)
downloadrpm-d6f6d2b565f8ccb005b3230fa987a9d961c64533.tar.gz
rpm-d6f6d2b565f8ccb005b3230fa987a9d961c64533.tar.bz2
rpm-d6f6d2b565f8ccb005b3230fa987a9d961c64533.zip
Initialize the LZMA encoder/decoder on demand, not both
Diffstat (limited to 'rpmio')
-rw-r--r--rpmio/rpmio.c6
-rw-r--r--rpmio/rpmio_internal.h2
2 files changed, 6 insertions, 2 deletions
diff --git a/rpmio/rpmio.c b/rpmio/rpmio.c
index e99e272c4..650c9f7d8 100644
--- a/rpmio/rpmio.c
+++ b/rpmio/rpmio.c
@@ -1227,7 +1227,11 @@ static LZFILE *lzopen_internal(const char *path, const char *mode, int fd)
return 0;
}
- lzma_init();
+ if ( encoding ) {
+ lzma_init_encoder();
+ } else {
+ lzma_init_decoder();
+ }
lzfile->file = fp;
lzfile->encoding = encoding;
diff --git a/rpmio/rpmio_internal.h b/rpmio/rpmio_internal.h
index 25c6d5b3c..eadcf9d7e 100644
--- a/rpmio/rpmio_internal.h
+++ b/rpmio/rpmio_internal.h
@@ -53,7 +53,7 @@ struct _FD_s {
ssize_t bytesRemain; /* ufdio: */
int syserrno; /* last system errno encountered */
- const void *errcookie; /* gzdio/bzdio/ufdio: */
+ const void *errcookie; /* gzdio/bzdio/ufdio/lzdio: */
FDSTAT_t stats; /* I/O statistics */