提交 cd12ed33 编写于 作者: C Cary Xu

enh: code optimization for tsdb path

上级 d51473bd
......@@ -38,14 +38,14 @@ int tsdbOpen(SVnode *pVnode, STsdb **ppTsdb, const char *dir, STsdbKeepCfg *pKee
int slen = 0;
*ppTsdb = NULL;
slen = TD_PATH_MAX; //strlen(pVnode->path) + strlen(dir) + 3;
// if (slen > TD_PATH_MAX) {
// terrno = TSDB_CODE_OUT_OF_RANGE;
// tsdbError("vgId:%d, tsdb open failed since %s, path: %s%s%s", TD_VID(pVnode), terrstr(), pVnode->path, TD_DIRSEP,
// dir);
// return -1;
// }
slen = strlen(pVnode->path) + strlen(dir) + 3;
if (slen > TD_PATH_MAX) {
terrno = TSDB_CODE_OUT_OF_RANGE;
tsdbError("vgId:%d, tsdb open failed since %s, path: %s%s%s", TD_VID(pVnode), terrstr(), pVnode->path, TD_DIRSEP,
dir);
return -1;
}
// create handle
pTsdb = (STsdb *)taosMemoryCalloc(1, sizeof(*pTsdb) + slen);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册