[TD-13756]<fix>: log file open fail error.

This commit is contained in:
afwerar 2022-04-02 10:51:46 +08:00
parent e9f2c1cdc0
commit 131bf46854
1 changed files with 3 additions and 1 deletions

View File

@ -353,7 +353,9 @@ static int32_t taosOpenLogFile(char *fn, int32_t maxLines, int32_t maxFileNum) {
printf("\nfailed to open log file:%s, reason:%s\n", fileName, strerror(errno));
return -1;
}
taosCloseFile(&tsLogObj.logHandle->pFile);
TdFilePtr pOldFile = tsLogObj.logHandle->pFile;
taosUnLockLogFile(pOldFile);
taosCloseFile(&pOldFile);
tsLogObj.logHandle->pFile = pFile;
taosLockLogFile(tsLogObj.logHandle->pFile);