enh: code optimization for PATH_MAX

This commit is contained in:
Cary Xu 2022-11-03 19:45:14 +08:00
parent 5c15e17b36
commit abc17227ab
1 changed files with 1 additions and 8 deletions

View File

@ -38,14 +38,7 @@ int tsdbOpen(SVnode *pVnode, STsdb **ppTsdb, const char *dir, STsdbKeepCfg *pKee
int slen = 0;
*ppTsdb = NULL;
slen = TD_PATH_MAX;
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) + 2;
// create handle
pTsdb = (STsdb *)taosMemoryCalloc(1, sizeof(*pTsdb) + slen);