提交 345743ab 编写于 作者: M Minglei Jin

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

上级 c8456b65
...@@ -35,6 +35,7 @@ int32_t tsdbOpenFile(const char *path, int32_t szPage, int32_t flag, STsdbFD **p ...@@ -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 ...@@ -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;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册