fix(tdb/restore): seek jfd to begin

This commit is contained in:
Minglei Jin 2022-12-22 17:56:56 +08:00
parent 053f48e33a
commit 336ee146e6
1 changed files with 6 additions and 0 deletions

View File

@ -869,6 +869,12 @@ static int tdbPagerRestore(SPager *pPager, const char *jFileName) {
return -1; return -1;
} }
if (tdbOsLSeek(jfd, 0L, SEEK_SET) < 0) {
tdbError("failed to lseek jfd due to %s. file:%s, offset:0", strerror(errno), pPager->dbFileName);
terrno = TAOS_SYSTEM_ERROR(errno);
return -1;
}
pageBuf = tdbOsCalloc(1, pPager->pageSize); pageBuf = tdbOsCalloc(1, pPager->pageSize);
if (pageBuf == NULL) { if (pageBuf == NULL) {
return -1; return -1;