From fef1c39ac89b54ac6440c7210cc565fa2f6f97c2 Mon Sep 17 00:00:00 2001 From: yaomanhai Date: Thu, 9 Sep 2021 13:32:55 +0000 Subject: [PATCH] codex issue fix Signed-off-by: yaomanhai --- services/hilogd/log_compress.cpp | 2 +- services/hilogd/log_persister_rotator.cpp | 2 +- services/hilogd/log_querier.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/services/hilogd/log_compress.cpp b/services/hilogd/log_compress.cpp index e32bdfd..1860f6b 100644 --- a/services/hilogd/log_compress.cpp +++ b/services/hilogd/log_compress.cpp @@ -124,7 +124,7 @@ int ZstdCompress::Compress(LogPersisterBuffer* &buffer, LogPersisterBuffer* &com cctx = ZSTD_createCCtx(); if (cctx == nullptr) { cout << "ZSTD_createCCtx() failed!" << endl; - DeleteZData();; + DeleteZData(); return -1; } ZSTD_CCtx_setParameter(cctx, ZSTD_c_compressionLevel, compressionlevel); diff --git a/services/hilogd/log_persister_rotator.cpp b/services/hilogd/log_persister_rotator.cpp index 9207c75..4865edd 100644 --- a/services/hilogd/log_persister_rotator.cpp +++ b/services/hilogd/log_persister_rotator.cpp @@ -33,7 +33,7 @@ uint64_t GetInfoHash(const PersistRecoveryInfo &info) const char *p = (char *)&info; unsigned long i = 0; while (i < sizeof(PersistRecoveryInfo)) { - ret ^= *(p+1); + ret ^= *(p + i); ret *= PRIME; i++; } diff --git a/services/hilogd/log_querier.cpp b/services/hilogd/log_querier.cpp index 4b35009..2a604e1 100644 --- a/services/hilogd/log_querier.cpp +++ b/services/hilogd/log_querier.cpp @@ -602,7 +602,7 @@ int LogQuerier::RestorePersistJobs(HilogBuffer& _buffer) fclose(infile); uint64_t hash = GetInfoHash(info); if (hash != hashSum) { - std::cout << "Info file Checksum Failed!" << std::endl; + std::cout << "Info file checksum Failed!" << std::endl; continue; } JobLauncher(info.msg, _buffer, true, info.index + 1); -- Gitee