mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2024-12-04 23:22:22 +01:00
GZIO: Update to use zlib 1.2.11.
PR: 229763 Submitted by: Yoshihiro Ota <ota j email ne jp> Differential Revision: https://reviews.freebsd.org/D21408
This commit is contained in:
parent
83ea714f4f
commit
4e8671dd78
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=351477
@ -66,8 +66,7 @@ SET_DECLARE(compressors, struct compressor_methods);
|
||||
|
||||
#ifdef GZIO
|
||||
|
||||
#include <sys/gsb_crc32.h>
|
||||
#include <sys/zutil.h>
|
||||
#include <contrib/zlib/zutil.h>
|
||||
|
||||
struct gz_stream {
|
||||
uint8_t *gz_buffer; /* output buffer */
|
||||
@ -141,7 +140,7 @@ gz_reset(void *stream)
|
||||
|
||||
s = stream;
|
||||
s->gz_off = 0;
|
||||
s->gz_crc = ~0U;
|
||||
s->gz_crc = crc32(0L, Z_NULL, 0);
|
||||
|
||||
(void)deflateReset(&s->gz_stream);
|
||||
s->gz_stream.avail_out = s->gz_bufsz;
|
||||
@ -173,9 +172,8 @@ gz_write(void *stream, void *data, size_t len, compressor_cb_t cb,
|
||||
if (len > 0) {
|
||||
s->gz_stream.avail_in = len;
|
||||
s->gz_stream.next_in = data;
|
||||
s->gz_crc = crc32_raw(data, len, s->gz_crc);
|
||||
} else
|
||||
s->gz_crc ^= ~0U;
|
||||
s->gz_crc = crc32(s->gz_crc, data, len);
|
||||
}
|
||||
|
||||
error = 0;
|
||||
do {
|
||||
|
Loading…
Reference in New Issue
Block a user