未验证 提交 74e53c6e 编写于 作者: S Shengliang Guan 提交者: GitHub

Merge pull request #3088 from taosdata/develop

Merge from develop into master
...@@ -246,22 +246,22 @@ uint32_t tsdbGetFileInfo(TSDB_REPO_T *repo, char *name, uint32_t *index, uint32_ ...@@ -246,22 +246,22 @@ uint32_t tsdbGetFileInfo(TSDB_REPO_T *repo, char *name, uint32_t *index, uint32_
} }
} }
strcpy(name, fname + prefixLen); strcpy(name, fname + prefixLen);
} else { // get the named file at the specified index. If not there, return 0 } else { // get the named file at the specified index. If not there, return 0
if (*index == TSDB_META_FILE_INDEX) { // get meta file fname = malloc(prefixLen + strlen(name) + 2);
fname = malloc(prefixLen + strlen(name) + 2); sprintf(fname, "%s/%s", prefix, name);
sprintf(fname, "%s/%s", prefix, name); if (access(fname, F_OK) != 0) {
tsdbGetStoreInfo(fname, &magic, size);
taosFree(fname); taosFree(fname);
taosFree(sdup); taosFree(sdup);
return magic; return 0;
}
if (*index == TSDB_META_FILE_INDEX) { // get meta file
tsdbGetStoreInfo(fname, &magic, size);
} else { } else {
fname = malloc(prefixLen + strlen(name) + 2);
sprintf(fname, "%s/%s", prefix, name);
tsdbGetFileInfoImpl(fname, &magic, size); tsdbGetFileInfoImpl(fname, &magic, size);
taosFree(fname);
taosFree(sdup);
return magic;
} }
taosFree(fname);
taosFree(sdup);
return magic;
} }
if (stat(fname, &fState) < 0) { if (stat(fname, &fState) < 0) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册