fix(tsdb/file): save errno for shell reporting

This commit is contained in:
Minglei Jin 2023-08-22 14:44:32 +08:00
parent c8456b650c
commit 345743aba5
1 changed files with 2 additions and 1 deletions

View File

@ -35,6 +35,7 @@ int32_t tsdbOpenFile(const char *path, int32_t szPage, int32_t flag, STsdbFD **p
pFD->flag = flag;
pFD->pFD = taosOpenFile(path, flag);
if (pFD->pFD == NULL) {
int errsv = errno;
const char *object_name = taosDirEntryBaseName((char *)path);
long s3_size = s3Size(object_name);
if (!strncmp(path + strlen(path) - 5, ".data", 5) && s3_size > 0) {
@ -49,7 +50,7 @@ int32_t tsdbOpenFile(const char *path, int32_t szPage, int32_t flag, STsdbFD **p
goto _exit;
}
} else {
code = TAOS_SYSTEM_ERROR(errno);
code = TAOS_SYSTEM_ERROR(errsv);
taosMemoryFree(pFD);
goto _exit;
}