From d98245d8c0a8562923c0de24245dd73e9671c33b Mon Sep 17 00:00:00 2001 From: kailixu Date: Thu, 26 Sep 2024 16:56:35 +0800 Subject: [PATCH] fix: overflow problem with large file --- source/util/src/tlog.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/source/util/src/tlog.c b/source/util/src/tlog.c index 274edeaa90..6a25c30704 100644 --- a/source/util/src/tlog.c +++ b/source/util/src/tlog.c @@ -541,7 +541,6 @@ static void processLogFileName(const char* logName , int32_t maxFileNum){ } static int32_t taosInitNormalLog(const char *logName, int32_t maxFileNum) { - int32_t code = 0; #ifdef WINDOWS_STASH /* * always set maxFileNum to 1 @@ -576,10 +575,10 @@ static int32_t taosInitNormalLog(const char *logName, int32_t maxFileNum) { } tsLogObj.lines = (int32_t)(filesize / 60); - if ((code = taosLSeekFile(tsLogObj.logHandle->pFile, 0, SEEK_END)) < 0) { - TAOS_UNUSED(printf("failed to seek to the end of log file:%s, reason:%s\n", name, tstrerror(code))); + if (taosLSeekFile(tsLogObj.logHandle->pFile, 0, SEEK_END) < 0) { + TAOS_UNUSED(printf("failed to seek to the end of log file:%s, reason:%s\n", name, tstrerror(terrno))); taosUnLockLogFile(tsLogObj.logHandle->pFile); - return code; + return terrno; } (void)sprintf(name, "==================================================\n");