fix: minor changes
This commit is contained in:
parent
4a90f84e26
commit
f5a6108ca0
|
@ -650,6 +650,9 @@ int32_t sdbStopWrite(SSdb *pSdb, SSdbIter *pIter, bool isApply, int64_t index, i
|
||||||
goto _OVER;
|
goto _OVER;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
taosCloseFile(&pIter->file);
|
||||||
|
pIter->file = NULL;
|
||||||
|
|
||||||
char datafile[PATH_MAX] = {0};
|
char datafile[PATH_MAX] = {0};
|
||||||
snprintf(datafile, sizeof(datafile), "%s%ssdb.data", pSdb->currDir, TD_DIRSEP);
|
snprintf(datafile, sizeof(datafile), "%s%ssdb.data", pSdb->currDir, TD_DIRSEP);
|
||||||
if (taosRenameFile(pIter->name, datafile) != 0) {
|
if (taosRenameFile(pIter->name, datafile) != 0) {
|
||||||
|
@ -677,8 +680,10 @@ int32_t sdbStopWrite(SSdb *pSdb, SSdbIter *pIter, bool isApply, int64_t index, i
|
||||||
code = 0;
|
code = 0;
|
||||||
|
|
||||||
_OVER:
|
_OVER:
|
||||||
|
if (pIter->file != NULL) {
|
||||||
taosCloseFile(&pIter->file);
|
taosCloseFile(&pIter->file);
|
||||||
pIter->file = NULL;
|
pIter->file = NULL;
|
||||||
|
}
|
||||||
sdbCloseIter(pIter);
|
sdbCloseIter(pIter);
|
||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue