diff options
author | Jindrich Novy <jnovy@redhat.com> | 2008-11-26 16:35:07 +0100 |
---|---|---|
committer | Jindrich Novy <jnovy@redhat.com> | 2008-11-26 16:44:53 +0100 |
commit | d6f6d2b565f8ccb005b3230fa987a9d961c64533 (patch) | |
tree | f306cc65758c8addafe31f6195bf1166a6e22f39 /rpmio | |
parent | 2494b26f01ae7447365fd3b62d028e4402f9cff5 (diff) | |
download | rpm-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.c | 6 | ||||
-rw-r--r-- | rpmio/rpmio_internal.h | 2 |
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 */ |