Merge pull request #28136 from taosdata/fix/TD-32331-3.0

fix: overflow problem with large file
This commit is contained in:
Hongze Cheng 2024-09-27 09:02:53 +08:00 committed by GitHub
commit 3e04f78b40
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 4 deletions

View File

@ -541,7 +541,6 @@ static void processLogFileName(const char* logName , int32_t maxFileNum){
} }
static int32_t taosInitNormalLog(const char *logName, int32_t maxFileNum) { static int32_t taosInitNormalLog(const char *logName, int32_t maxFileNum) {
int32_t code = 0;
#ifdef WINDOWS_STASH #ifdef WINDOWS_STASH
/* /*
* always set maxFileNum to 1 * 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); tsLogObj.lines = (int32_t)(filesize / 60);
if ((code = taosLSeekFile(tsLogObj.logHandle->pFile, 0, SEEK_END)) < 0) { 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(code))); TAOS_UNUSED(printf("failed to seek to the end of log file:%s, reason:%s\n", name, tstrerror(terrno)));
taosUnLockLogFile(tsLogObj.logHandle->pFile); taosUnLockLogFile(tsLogObj.logHandle->pFile);
return code; return terrno;
} }
(void)sprintf(name, "==================================================\n"); (void)sprintf(name, "==================================================\n");