Merge pull request #22515 from taosdata/fix/TD-25819-2
fix(tsdb/file): save errno for shell reporting
This commit is contained in:
commit
8c4062c1b0
|
@ -35,6 +35,7 @@ int32_t tsdbOpenFile(const char *path, int32_t szPage, int32_t flag, STsdbFD **p
|
||||||
pFD->flag = flag;
|
pFD->flag = flag;
|
||||||
pFD->pFD = taosOpenFile(path, flag);
|
pFD->pFD = taosOpenFile(path, flag);
|
||||||
if (pFD->pFD == NULL) {
|
if (pFD->pFD == NULL) {
|
||||||
|
int errsv = errno;
|
||||||
const char *object_name = taosDirEntryBaseName((char *)path);
|
const char *object_name = taosDirEntryBaseName((char *)path);
|
||||||
long s3_size = s3Size(object_name);
|
long s3_size = s3Size(object_name);
|
||||||
if (!strncmp(path + strlen(path) - 5, ".data", 5) && s3_size > 0) {
|
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;
|
goto _exit;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
code = TAOS_SYSTEM_ERROR(errno);
|
code = TAOS_SYSTEM_ERROR(errsv);
|
||||||
taosMemoryFree(pFD);
|
taosMemoryFree(pFD);
|
||||||
goto _exit;
|
goto _exit;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue