[TD-13756]<fix>: log file open fail error.
This commit is contained in:
parent
34f5f3fbfe
commit
42231d7691
|
@ -347,12 +347,13 @@ static int32_t taosOpenLogFile(char *fn, int32_t maxLines, int32_t maxFileNum) {
|
|||
taosThreadMutexInit(&tsLogObj.logMutex, NULL);
|
||||
|
||||
taosUmaskFile(0);
|
||||
tsLogObj.logHandle->pFile = taosOpenFile(fileName, TD_FILE_CTEATE | TD_FILE_WRITE);
|
||||
TdFilePtr pFile = taosOpenFile(fileName, TD_FILE_CTEATE | TD_FILE_WRITE);
|
||||
|
||||
if (tsLogObj.logHandle->pFile == NULL) {
|
||||
if (pFile == NULL) {
|
||||
printf("\nfailed to open log file:%s, reason:%s\n", fileName, strerror(errno));
|
||||
return -1;
|
||||
}
|
||||
tsLogObj.logHandle->pFile = pFile;
|
||||
taosLockLogFile(tsLogObj.logHandle->pFile);
|
||||
|
||||
// only an estimate for number of lines
|
||||
|
|
Loading…
Reference in New Issue