diff --git a/source/util/src/tlog.c b/source/util/src/tlog.c index 88eccfaffd..4df5b322a2 100644 --- a/source/util/src/tlog.c +++ b/source/util/src/tlog.c @@ -673,11 +673,11 @@ static int32_t taosInitNormalLog(const char *logName, int32_t maxFileNum) { } _exit: - taosUnLockLogFile(tsLogObj.logHandle->pFile); if (code != 0) { + taosUnLockLogFile(tsLogObj.logHandle->pFile); TAOS_UNUSED(printf("failed to init normal log file:%s at line %d, reason:%s\n", name, lino, tstrerror(code))); } - return 0; + return code; } static void taosUpdateLogNums(ELogLevel level) {