mirror of
https://github.com/ckolivas/lrzip.git
synced 2025-12-06 07:12:00 +01:00
Work around corrupt archives when compressing small files with lzma to stdout.
This commit is contained in:
parent
590377819c
commit
de2c9c5f62
8
stream.c
8
stream.c
|
|
@ -1293,6 +1293,14 @@ static void *compthread(void *data)
|
||||||
/* Flushing writes to disk frees up any dirty ram, improving chances
|
/* Flushing writes to disk frees up any dirty ram, improving chances
|
||||||
* of succeeding in allocating more ram */
|
* of succeeding in allocating more ram */
|
||||||
fsync(ctis->fd);
|
fsync(ctis->fd);
|
||||||
|
|
||||||
|
/* This is a cludge in case we are compressing to stdout and our first
|
||||||
|
* stream is not compressed, but subsequent ones are compressed by
|
||||||
|
* lzma and we can no longer seek back to the beginning of the file
|
||||||
|
* to write the lzma properties which are effectively always starting
|
||||||
|
* with 93. */
|
||||||
|
if (TMP_OUTBUF && LZMA_COMPRESS)
|
||||||
|
control->lzma_properties[0] = 93;
|
||||||
retry:
|
retry:
|
||||||
/* Very small buffers have issues to do with minimum amounts of ram
|
/* Very small buffers have issues to do with minimum amounts of ram
|
||||||
* allocatable to a buffer combined with the MINIMUM_MATCH of rzip
|
* allocatable to a buffer combined with the MINIMUM_MATCH of rzip
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue