mirror of
https://github.com/ckolivas/lrzip.git
synced 2026-04-05 06:15:28 +00:00
Prepare to write compressed output by flushing stdout after each chunk is compressed.
This commit is contained in:
parent
c75a50f723
commit
7fbec0a783
5 changed files with 34 additions and 8 deletions
4
stream.c
4
stream.c
|
|
@ -637,10 +637,12 @@ const i64 one_g = 1000 * 1024 * 1024;
|
|||
|
||||
ssize_t put_fdout(rzip_control *control, int fd, void *offset_buf, ssize_t ret)
|
||||
{
|
||||
if (!STDOUT)
|
||||
if (!STDOUT || DECOMPRESS)
|
||||
return write(fd, offset_buf, (size_t)ret);
|
||||
memcpy(control->tmp_outbuf, offset_buf, ret);
|
||||
control->out_ofs += ret;
|
||||
if (likely(control->out_ofs > control->out_len))
|
||||
control->out_len = control->out_ofs;
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue