From 2dbdc0bbc863c992638271497a1da1f6513aad18 Mon Sep 17 00:00:00 2001 From: kailixu Date: Wed, 25 Sep 2024 11:17:40 +0800 Subject: [PATCH 1/4] enh: return value process --- source/util/src/tlog.c | 136 +++++++++++++++++++++++++++-------------- 1 file changed, 89 insertions(+), 47 deletions(-) diff --git a/source/util/src/tlog.c b/source/util/src/tlog.c index aea6647e4c..b8433d3b5d 100644 --- a/source/util/src/tlog.c +++ b/source/util/src/tlog.c @@ -153,14 +153,16 @@ static void getDay(char* buf){ time_t t = taosTime(NULL); struct tm tmInfo; if (taosLocalTime(&t, &tmInfo, buf) != NULL) { - (void)strftime(buf, LOG_FILE_DAY_LEN, "%Y-%m-%d", &tmInfo); + TAOS_UNUSED(strftime(buf, LOG_FILE_DAY_LEN, "%Y-%m-%d", &tmInfo)); } } static int64_t getTimestampToday() { time_t t = taosTime(NULL); struct tm tm; - (void) taosLocalTime(&t, &tm, NULL); + if (taosLocalTime(&t, &tm, NULL) == NULL) { + return 0; + } tm.tm_hour = 0; tm.tm_min = 0; tm.tm_sec = 0; @@ -203,7 +205,7 @@ int32_t taosInitSlowLog() { tsLogObj.slowHandle = taosLogBuffNew(LOG_SLOW_BUF_SIZE); if (tsLogObj.slowHandle == NULL) return terrno; - (void)taosUmaskFile(0); + TAOS_UNUSED(taosUmaskFile(0)); tsLogObj.slowHandle->pFile = taosOpenFile(name, TD_FILE_CREATE | TD_FILE_WRITE | TD_FILE_APPEND); if (tsLogObj.slowHandle->pFile == NULL) { (void)printf("\nfailed to open slow log file:%s, reason:%s\n", name, strerror(errno)); @@ -281,7 +283,10 @@ static void taosUnLockLogFile(TdFilePtr pFile) { if (pFile == NULL) return; if (tsLogObj.fileNum > 1) { - (void)taosUnLockFile(pFile); + int32_t code = taosUnLockFile(pFile); + if (code != 0) { + printf("failed to unlock log file:%p, reason:%s\n", pFile, tstrerror(code)); + } } } @@ -310,7 +315,10 @@ static void taosKeepOldLog(char *oldName) { char compressFileName[PATH_MAX + 20]; snprintf(compressFileName, PATH_MAX + 20, "%s.gz", oldName); if (taosCompressFile(oldName, compressFileName) == 0) { - (void)taosRemoveFile(oldName); + int32_t code = taosRemoveFile(oldName); + if (code != 0) { + printf("failed to remove file:%s, reason:%s\n", oldName, tstrerror(code)); + } } } @@ -331,7 +339,7 @@ static OldFileKeeper *taosOpenNewFile() { char name[PATH_MAX + 20]; sprintf(name, "%s.%d", tsLogObj.logName, tsLogObj.flag); - (void)taosUmaskFile(0); + TAOS_UNUSED(taosUmaskFile(0)); TdFilePtr pFile = taosOpenFile(name, TD_FILE_CREATE | TD_FILE_WRITE | TD_FILE_TRUNC); if (pFile == NULL) { @@ -341,8 +349,8 @@ static OldFileKeeper *taosOpenNewFile() { return NULL; } - (void)taosLockLogFile(pFile); - (void)taosLSeekFile(pFile, 0, SEEK_SET); + TAOS_UNUSED(taosLockLogFile(pFile)); + TAOS_UNUSED(taosLSeekFile(pFile, 0, SEEK_SET)); TdFilePtr pOldFile = tsLogObj.logHandle->pFile; tsLogObj.logHandle->pFile = pFile; @@ -384,7 +392,14 @@ static int32_t taosOpenNewLogFile() { (void)taosThreadAttrSetDetachState(&attr, PTHREAD_CREATE_DETACHED); OldFileKeeper *oldFileKeeper = taosOpenNewFile(); - (void)taosThreadCreate(&thread, &attr, taosThreadToCloseOldFile, oldFileKeeper); + if (!oldFileKeeper) { + (void)taosThreadMutexUnlock(&tsLogObj.logMutex); + return terrno; + } + if (taosThreadCreate(&thread, &attr, taosThreadToCloseOldFile, oldFileKeeper) != 0) { + uError("failed to create thread to close old log file"); + taosMemoryFreeClear(oldFileKeeper); + } (void)taosThreadAttrDestroy(&attr); } @@ -404,7 +419,7 @@ static void taosOpenNewSlowLogFile() { for (int32_t i = 1; atomic_val_compare_exchange_32(&tsLogObj.slowHandle->lock, 0, 1) == 1; ++i) { if (i % 1000 == 0) { - (void)sched_yield(); + TAOS_UNUSED(sched_yield()); } } tsLogObj.slowHandle->lastDuration = LOG_MAX_WAIT_MSEC; // force write @@ -435,7 +450,10 @@ void taosResetLog() { tsLogObj.lines = tsNumOfLogLines + 10; if (tsLogObj.logHandle) { - (void)taosOpenNewLogFile(); + int32_t code = taosOpenNewLogFile(); + if(code != 0){ + uError("failed to open new log file, reason:%s", tstrerror(code)); + } uInfo("=================================="); uInfo(" reset log file "); } @@ -521,6 +539,7 @@ 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 @@ -528,14 +547,13 @@ static int32_t taosInitNormalLog(const char *logName, int32_t maxFileNum) { */ maxFileNum = 1; #endif - processLogFileName(logName, maxFileNum); char name[PATH_MAX + 50] = "\0"; (void)sprintf(name, "%s.%d", tsLogObj.logName, tsLogObj.flag); (void)taosThreadMutexInit(&tsLogObj.logMutex, NULL); - (void)taosUmaskFile(0); + TAOS_UNUSED(taosUmaskFile(0)); tsLogObj.logHandle = taosLogBuffNew(LOG_DEFAULT_BUF_SIZE); if (tsLogObj.logHandle == NULL) return terrno; @@ -544,7 +562,7 @@ static int32_t taosInitNormalLog(const char *logName, int32_t maxFileNum) { (void)printf("\nfailed to open log file:%s, reason:%s\n", name, strerror(errno)); return terrno; } - (void)taosLockLogFile(tsLogObj.logHandle->pFile); + TAOS_UNUSED(taosLockLogFile(tsLogObj.logHandle->pFile)); // only an estimate for number of lines int64_t filesize = 0; @@ -554,14 +572,26 @@ static int32_t taosInitNormalLog(const char *logName, int32_t maxFileNum) { } tsLogObj.lines = (int32_t)(filesize / 60); - (void)taosLSeekFile(tsLogObj.logHandle->pFile, 0, SEEK_END); + 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))); + return code; + } (void)sprintf(name, "==================================================\n"); - (void)taosWriteFile(tsLogObj.logHandle->pFile, name, (uint32_t)strlen(name)); + if (taosWriteFile(tsLogObj.logHandle->pFile, name, (uint32_t)strlen(name)) <= 0) { + TAOS_UNUSED(printf("failed to write to log file:%s, reason:%s\n", name, tstrerror(terrno))); + return terrno; + } (void)sprintf(name, " new log file \n"); - (void)taosWriteFile(tsLogObj.logHandle->pFile, name, (uint32_t)strlen(name)); + if (taosWriteFile(tsLogObj.logHandle->pFile, name, (uint32_t)strlen(name)) <= 0) { + TAOS_UNUSED(printf("failed to write to log file:%s, reason:%s\n", name, tstrerror(terrno))); + return terrno; + } (void)sprintf(name, "==================================================\n"); - (void)taosWriteFile(tsLogObj.logHandle->pFile, name, (uint32_t)strlen(name)); + if (taosWriteFile(tsLogObj.logHandle->pFile, name, (uint32_t)strlen(name)) <= 0) { + TAOS_UNUSED(printf("failed to write to log file:%s, reason:%s\n", name, tstrerror(terrno))); + return terrno; + } return 0; } @@ -569,17 +599,17 @@ static int32_t taosInitNormalLog(const char *logName, int32_t maxFileNum) { static void taosUpdateLogNums(ELogLevel level) { switch (level) { case DEBUG_ERROR: - (void)atomic_add_fetch_64(&tsNumOfErrorLogs, 1); + TAOS_UNUSED(atomic_add_fetch_64(&tsNumOfErrorLogs, 1)); break; case DEBUG_INFO: - (void)atomic_add_fetch_64(&tsNumOfInfoLogs, 1); + TAOS_UNUSED(atomic_add_fetch_64(&tsNumOfInfoLogs, 1)); break; case DEBUG_DEBUG: - (void)atomic_add_fetch_64(&tsNumOfDebugLogs, 1); + TAOS_UNUSED(atomic_add_fetch_64(&tsNumOfDebugLogs, 1)); break; case DEBUG_DUMP: case DEBUG_TRACE: - (void)atomic_add_fetch_64(&tsNumOfTraceLogs, 1); + TAOS_UNUSED(atomic_add_fetch_64(&tsNumOfTraceLogs, 1)); break; default: break; @@ -590,7 +620,7 @@ static inline int32_t taosBuildLogHead(char *buffer, const char *flags) { struct tm Tm, *ptm; struct timeval timeSecs; - (void)taosGetTimeOfDay(&timeSecs); + TAOS_UNUSED(taosGetTimeOfDay(&timeSecs)); time_t curTime = timeSecs.tv_sec; ptm = taosLocalTime(&curTime, &Tm, NULL); @@ -603,15 +633,20 @@ static inline void taosPrintLogImp(ELogLevel level, int32_t dflag, const char *b if ((dflag & DEBUG_FILE) && tsLogObj.logHandle && tsLogObj.logHandle->pFile != NULL && osLogSpaceSufficient()) { taosUpdateLogNums(level); if (tsAsyncLog) { - (void)taosPushLogBuffer(tsLogObj.logHandle, buffer, len); + TAOS_UNUSED(taosPushLogBuffer(tsLogObj.logHandle, buffer, len)); } else { - (void)taosWriteFile(tsLogObj.logHandle->pFile, buffer, len); + if (taosWriteFile(tsLogObj.logHandle->pFile, buffer, len) <= 0) { + printf("failed to write log to file, reason:%s\n", tstrerror(terrno)); + } } if (tsNumOfLogLines > 0) { - (void)atomic_add_fetch_32(&tsLogObj.lines, 1); + TAOS_UNUSED(atomic_add_fetch_32(&tsLogObj.lines, 1)); if ((tsLogObj.lines > tsNumOfLogLines) && (tsLogObj.openInProgress == 0)) { - (void)taosOpenNewLogFile(); + int32_t code = taosOpenNewLogFile(); + if (code != 0) { + uError("failed to open new log file, reason:%s", tstrerror(code)); + } } } } @@ -619,7 +654,9 @@ static inline void taosPrintLogImp(ELogLevel level, int32_t dflag, const char *b if (dflag & DEBUG_SCREEN) { #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-result" - (void)write(1, buffer, (uint32_t)len); + if (write(1, buffer, (uint32_t)len) < 0) { + printf("failed to write log to screen, reason:%s\n", strerror(errno)); + } #pragma GCC diagnostic pop } } @@ -690,12 +727,14 @@ void taosPrintSlowLog(const char *format, ...) { buffer[len++] = '\n'; buffer[len] = 0; - (void)atomic_add_fetch_64(&tsNumOfSlowLogs, 1); + TAOS_UNUSED(atomic_add_fetch_64(&tsNumOfSlowLogs, 1)); if (tsAsyncLog) { - (void)taosPushLogBuffer(tsLogObj.slowHandle, buffer, len); + TAOS_UNUSED(taosPushLogBuffer(tsLogObj.slowHandle, buffer, len)); } else { - (void)taosWriteFile(tsLogObj.slowHandle->pFile, buffer, len); + if (taosWriteFile(tsLogObj.slowHandle->pFile, buffer, len) <= 0) { + printf("failed to write slow log to file, reason:%s\n", tstrerror(terrno)); + } } taosMemoryFree(buffer); @@ -714,7 +753,7 @@ void taosDumpData(unsigned char *msg, int32_t len) { pos += 3; if (c >= 16) { temp[pos++] = '\n'; - (void)taosWriteFile(tsLogObj.logHandle->pFile, temp, (uint32_t)pos); + TAOS_UNUSED((taosWriteFile(tsLogObj.logHandle->pFile, temp, (uint32_t)pos) <= 0)); c = 0; pos = 0; } @@ -722,7 +761,7 @@ void taosDumpData(unsigned char *msg, int32_t len) { temp[pos++] = '\n'; - (void)taosWriteFile(tsLogObj.logHandle->pFile, temp, (uint32_t)pos); + TAOS_UNUSED(taosWriteFile(tsLogObj.logHandle->pFile, temp, (uint32_t)pos)); } static void taosCloseLogByFd(TdFilePtr pFile) { @@ -855,12 +894,12 @@ static void taosWriteLog(SLogBuff *pLogBuf) { pLogBuf->lastDuration = 0; if (start < end) { - (void)taosWriteFile(pLogBuf->pFile, LOG_BUF_BUFFER(pLogBuf) + start, pollSize); + TAOS_UNUSED(taosWriteFile(pLogBuf->pFile, LOG_BUF_BUFFER(pLogBuf) + start, pollSize)); } else { int32_t tsize = LOG_BUF_SIZE(pLogBuf) - start; - (void)taosWriteFile(pLogBuf->pFile, LOG_BUF_BUFFER(pLogBuf) + start, tsize); + TAOS_UNUSED(taosWriteFile(pLogBuf->pFile, LOG_BUF_BUFFER(pLogBuf) + start, tsize)); - (void)taosWriteFile(pLogBuf->pFile, LOG_BUF_BUFFER(pLogBuf), end); + TAOS_UNUSED(taosWriteFile(pLogBuf->pFile, LOG_BUF_BUFFER(pLogBuf), end)); } dbgWN++; @@ -981,11 +1020,14 @@ void taosLogCrashInfo(char *nodeType, char *pMsg, int64_t msgLen, int signum, vo goto _return; } - (void)taosLockFile(pFile); + if (taosLockFile(pFile) < 0) { + taosPrintLog(flags, level, dflag, "failed to lock file:%s since %s", filepath, terrstr()); + goto _return; + } int64_t writeSize = taosWriteFile(pFile, &msgLen, sizeof(msgLen)); if (sizeof(msgLen) != writeSize) { - (void)taosUnLockFile(pFile); + TAOS_UNUSED(taosUnLockFile(pFile)); taosPrintLog(flags, level, dflag, "failed to write len to file:%s,%p wlen:%" PRId64 " tlen:%lu since %s", filepath, pFile, writeSize, sizeof(msgLen), terrstr()); goto _return; @@ -993,13 +1035,13 @@ void taosLogCrashInfo(char *nodeType, char *pMsg, int64_t msgLen, int signum, vo writeSize = taosWriteFile(pFile, pMsg, msgLen); if (msgLen != writeSize) { - (void)taosUnLockFile(pFile); + TAOS_UNUSED(taosUnLockFile(pFile)); taosPrintLog(flags, level, dflag, "failed to write file:%s,%p wlen:%" PRId64 " tlen:%" PRId64 " since %s", filepath, pFile, writeSize, msgLen, terrstr()); goto _return; } - (void)taosUnLockFile(pFile); + TAOS_UNUSED(taosUnLockFile(pFile)); } _return: @@ -1054,7 +1096,7 @@ void taosReadCrashInfo(char *filepath, char **pMsg, int64_t *pMsgLen, TdFilePtr return; } - (void)taosLockFile(pFile); + TAOS_UNUSED(taosLockFile(pFile)); } else { pFile = *pFd; } @@ -1093,10 +1135,10 @@ void taosReadCrashInfo(char *filepath, char **pMsg, int64_t *pMsgLen, TdFilePtr _return: if (truncateFile) { - (void)taosFtruncateFile(pFile, 0); + TAOS_UNUSED(taosFtruncateFile(pFile, 0)); } - (void)taosUnLockFile(pFile); - (void)taosCloseFile(&pFile); + TAOS_UNUSED(taosUnLockFile(pFile)); + TAOS_UNUSED(taosCloseFile(&pFile)); taosMemoryFree(buf); *pMsg = NULL; @@ -1106,11 +1148,11 @@ _return: void taosReleaseCrashLogFile(TdFilePtr pFile, bool truncateFile) { if (truncateFile) { - (void)taosFtruncateFile(pFile, 0); + TAOS_UNUSED(taosFtruncateFile(pFile, 0)); } - (void)taosUnLockFile(pFile); - (void)taosCloseFile(&pFile); + TAOS_UNUSED(taosUnLockFile(pFile)); + TAOS_UNUSED(taosCloseFile(&pFile)); } #ifdef NDEBUG From caa44873b899643e15bb021b934b61715798b8d7 Mon Sep 17 00:00:00 2001 From: kailixu Date: Wed, 25 Sep 2024 11:24:44 +0800 Subject: [PATCH 2/4] enh: return value process --- source/util/src/tlog.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/source/util/src/tlog.c b/source/util/src/tlog.c index b8433d3b5d..bae19a91bd 100644 --- a/source/util/src/tlog.c +++ b/source/util/src/tlog.c @@ -285,7 +285,7 @@ static void taosUnLockLogFile(TdFilePtr pFile) { if (tsLogObj.fileNum > 1) { int32_t code = taosUnLockFile(pFile); if (code != 0) { - printf("failed to unlock log file:%p, reason:%s\n", pFile, tstrerror(code)); + TAOS_UNUSED(printf("failed to unlock log file:%p, reason:%s\n", pFile, tstrerror(code))); } } } @@ -317,7 +317,7 @@ static void taosKeepOldLog(char *oldName) { if (taosCompressFile(oldName, compressFileName) == 0) { int32_t code = taosRemoveFile(oldName); if (code != 0) { - printf("failed to remove file:%s, reason:%s\n", oldName, tstrerror(code)); + TAOS_UNUSED(printf("failed to remove file:%s, reason:%s\n", oldName, tstrerror(code))); } } } @@ -393,7 +393,7 @@ static int32_t taosOpenNewLogFile() { OldFileKeeper *oldFileKeeper = taosOpenNewFile(); if (!oldFileKeeper) { - (void)taosThreadMutexUnlock(&tsLogObj.logMutex); + TAOS_UNUSED(taosThreadMutexUnlock(&tsLogObj.logMutex)); return terrno; } if (taosThreadCreate(&thread, &attr, taosThreadToCloseOldFile, oldFileKeeper) != 0) { @@ -636,7 +636,7 @@ static inline void taosPrintLogImp(ELogLevel level, int32_t dflag, const char *b TAOS_UNUSED(taosPushLogBuffer(tsLogObj.logHandle, buffer, len)); } else { if (taosWriteFile(tsLogObj.logHandle->pFile, buffer, len) <= 0) { - printf("failed to write log to file, reason:%s\n", tstrerror(terrno)); + TAOS_UNUSED(printf("failed to write log to file, reason:%s\n", tstrerror(terrno))); } } @@ -655,7 +655,7 @@ static inline void taosPrintLogImp(ELogLevel level, int32_t dflag, const char *b #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-result" if (write(1, buffer, (uint32_t)len) < 0) { - printf("failed to write log to screen, reason:%s\n", strerror(errno)); + TAOS_UNUSED(printf("failed to write log to screen, reason:%s\n", strerror(errno))); } #pragma GCC diagnostic pop } @@ -733,7 +733,7 @@ void taosPrintSlowLog(const char *format, ...) { TAOS_UNUSED(taosPushLogBuffer(tsLogObj.slowHandle, buffer, len)); } else { if (taosWriteFile(tsLogObj.slowHandle->pFile, buffer, len) <= 0) { - printf("failed to write slow log to file, reason:%s\n", tstrerror(terrno)); + TAOS_UNUSED(printf("failed to write slow log to file, reason:%s\n", tstrerror(terrno))); } } From 6e6df9fa08ae3c468e9898189e1411c0d10583a1 Mon Sep 17 00:00:00 2001 From: kailixu Date: Wed, 25 Sep 2024 14:18:47 +0800 Subject: [PATCH 3/4] enh: return value process --- source/util/src/tlog.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/source/util/src/tlog.c b/source/util/src/tlog.c index bae19a91bd..2a5de3dfe0 100644 --- a/source/util/src/tlog.c +++ b/source/util/src/tlog.c @@ -350,7 +350,9 @@ static OldFileKeeper *taosOpenNewFile() { } TAOS_UNUSED(taosLockLogFile(pFile)); - TAOS_UNUSED(taosLSeekFile(pFile, 0, SEEK_SET)); + if (taosLSeekFile(pFile, 0, SEEK_SET) < 0) { + uWarn("failed to seek file:%s, reason:%s", name, tstrerror(terrno)); + } TdFilePtr pOldFile = tsLogObj.logHandle->pFile; tsLogObj.logHandle->pFile = pFile; @@ -568,28 +570,33 @@ static int32_t taosInitNormalLog(const char *logName, int32_t maxFileNum) { int64_t filesize = 0; if (taosFStatFile(tsLogObj.logHandle->pFile, &filesize, NULL) != 0) { (void)printf("\nfailed to fstat log file:%s, reason:%s\n", name, strerror(errno)); + taosUnLockLogFile(tsLogObj.logHandle->pFile); return terrno; } 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))); + taosUnLockLogFile(tsLogObj.logHandle->pFile); return code; } (void)sprintf(name, "==================================================\n"); if (taosWriteFile(tsLogObj.logHandle->pFile, name, (uint32_t)strlen(name)) <= 0) { TAOS_UNUSED(printf("failed to write to log file:%s, reason:%s\n", name, tstrerror(terrno))); + taosUnLockLogFile(tsLogObj.logHandle->pFile); return terrno; } (void)sprintf(name, " new log file \n"); if (taosWriteFile(tsLogObj.logHandle->pFile, name, (uint32_t)strlen(name)) <= 0) { TAOS_UNUSED(printf("failed to write to log file:%s, reason:%s\n", name, tstrerror(terrno))); + taosUnLockLogFile(tsLogObj.logHandle->pFile); return terrno; } (void)sprintf(name, "==================================================\n"); if (taosWriteFile(tsLogObj.logHandle->pFile, name, (uint32_t)strlen(name)) <= 0) { TAOS_UNUSED(printf("failed to write to log file:%s, reason:%s\n", name, tstrerror(terrno))); + taosUnLockLogFile(tsLogObj.logHandle->pFile); return terrno; } @@ -635,9 +642,7 @@ static inline void taosPrintLogImp(ELogLevel level, int32_t dflag, const char *b if (tsAsyncLog) { TAOS_UNUSED(taosPushLogBuffer(tsLogObj.logHandle, buffer, len)); } else { - if (taosWriteFile(tsLogObj.logHandle->pFile, buffer, len) <= 0) { - TAOS_UNUSED(printf("failed to write log to file, reason:%s\n", tstrerror(terrno))); - } + TAOS_UNUSED(taosWriteFile(tsLogObj.logHandle->pFile, buffer, len)); } if (tsNumOfLogLines > 0) { @@ -732,9 +737,7 @@ void taosPrintSlowLog(const char *format, ...) { if (tsAsyncLog) { TAOS_UNUSED(taosPushLogBuffer(tsLogObj.slowHandle, buffer, len)); } else { - if (taosWriteFile(tsLogObj.slowHandle->pFile, buffer, len) <= 0) { - TAOS_UNUSED(printf("failed to write slow log to file, reason:%s\n", tstrerror(terrno))); - } + TAOS_UNUSED(taosWriteFile(tsLogObj.slowHandle->pFile, buffer, len)); } taosMemoryFree(buffer); From 9fae6c25e39a716f3798a36b558a1dcfc064ec0c Mon Sep 17 00:00:00 2001 From: kailixu Date: Wed, 25 Sep 2024 14:22:51 +0800 Subject: [PATCH 4/4] enh: return value process --- source/util/src/tlog.c | 1 + 1 file changed, 1 insertion(+) diff --git a/source/util/src/tlog.c b/source/util/src/tlog.c index 2a5de3dfe0..274edeaa90 100644 --- a/source/util/src/tlog.c +++ b/source/util/src/tlog.c @@ -549,6 +549,7 @@ static int32_t taosInitNormalLog(const char *logName, int32_t maxFileNum) { */ maxFileNum = 1; #endif + processLogFileName(logName, maxFileNum); char name[PATH_MAX + 50] = "\0";