diff options
author | delphij <delphij@FreeBSD.org> | 2010-09-23 01:24:33 +0000 |
---|---|---|
committer | delphij <delphij@FreeBSD.org> | 2010-09-23 01:24:33 +0000 |
commit | 2dd5415ff3a6817e90055b3a1e759b89c45b0232 (patch) | |
tree | c6d59f21e3c5e6fc3f6f20c4ab97fcf9556dea21 /usr.bin/gzip | |
parent | f029ecd9aaa6b7e1270edd7e076e67a38dc96ff5 (diff) | |
download | FreeBSD-src-2dd5415ff3a6817e90055b3a1e759b89c45b0232.zip FreeBSD-src-2dd5415ff3a6817e90055b3a1e759b89c45b0232.tar.gz |
In the past gunzip(1) write()'s after each inflate return. This is
not optimal from a performance standpoint since the write buffer is
not necessarily be filled up when the inflate rountine reached the
end of input buffer and it's not the end of file.
This problem gets uncovered by trying to pipe gunzip -c output to
a GEOM device directly, which enforces the writes be multiple of
sector size.
Sponsored by: iXsystems, Inc.
Reported by: jpaetzel
MFC after: 2 weeks
Diffstat (limited to 'usr.bin/gzip')
-rw-r--r-- | usr.bin/gzip/gzip.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/usr.bin/gzip/gzip.c b/usr.bin/gzip/gzip.c index 4e16bf7..3f9bb4a 100644 --- a/usr.bin/gzip/gzip.c +++ b/usr.bin/gzip/gzip.c @@ -916,6 +916,8 @@ gz_uncompress(int in, int out, char *pre, size_t prelen, off_t *gsizep, switch (error) { /* Z_BUF_ERROR goes with Z_FINISH... */ case Z_BUF_ERROR: + if (z.avail_out > 0 && !done_reading) + continue; case Z_STREAM_END: case Z_OK: break; |