From f783dc765dca02949206adf06f28b026d0b7c0b2 Mon Sep 17 00:00:00 2001 From: Kaili Xu Date: Wed, 25 Dec 2024 09:08:32 +0800 Subject: [PATCH] enh: code optimization of tlog.c --- source/util/src/tlog.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/util/src/tlog.c b/source/util/src/tlog.c index 053ade2d5e..88eccfaffd 100644 --- a/source/util/src/tlog.c +++ b/source/util/src/tlog.c @@ -661,7 +661,7 @@ static int32_t taosInitNormalLog(const char *logName, int32_t maxFileNum) { tsLogObj.lines = (int32_t)(filesize / 60); if (taosLSeekFile(tsLogObj.logHandle->pFile, 0, SEEK_END) < 0) { - TAOS_CHECK_EXIT(code = terrno ? terrno : -1); + TAOS_CHECK_EXIT(terrno); } (void)snprintf(name, sizeof(name), @@ -669,7 +669,7 @@ static int32_t taosInitNormalLog(const char *logName, int32_t maxFileNum) { " new log file\n" "==================================================\n"); if (taosWriteFile(tsLogObj.logHandle->pFile, name, (uint32_t)strlen(name)) <= 0) { - TAOS_CHECK_EXIT(code = terrno ? terrno : -1); + TAOS_CHECK_EXIT(terrno); } _exit: