From 77a15ba44cc96544ed8efb0c55eed7ff348a718a Mon Sep 17 00:00:00 2001 From: yaomanhai Date: Tue, 7 Jun 2022 09:47:19 +0000 Subject: [PATCH] Use default parameter for deflateInit, it's more reliable Signed-off-by: yaomanhai --- services/hilogd/log_compress.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/hilogd/log_compress.cpp b/services/hilogd/log_compress.cpp index 4310920..dc40c7d 100644 --- a/services/hilogd/log_compress.cpp +++ b/services/hilogd/log_compress.cpp @@ -39,7 +39,7 @@ int ZlibCompress::Compress(const LogPersisterBuffer &inBuffer, LogPersisterBuffe cStream.zalloc = Z_NULL; cStream.zfree = Z_NULL; cStream.opaque = Z_NULL; - if (deflateInit2(&cStream, Z_DEFAULT_COMPRESSION, Z_DEFLATED, MAX_WBITS + 16, 8, Z_DEFAULT_STRATEGY) != Z_OK) { + if (deflateInit(&cStream, Z_DEFAULT_COMPRESSION) != Z_OK) { return -1; } uint32_t zdlen = deflateBound(&cStream, inBuffer.offset); -- Gitee