enh: code optimization for tsdb path
This commit is contained in:
parent
d51473bd6b
commit
cd12ed33a2
|
@ -38,14 +38,14 @@ int tsdbOpen(SVnode *pVnode, STsdb **ppTsdb, const char *dir, STsdbKeepCfg *pKee
|
||||||
int slen = 0;
|
int slen = 0;
|
||||||
|
|
||||||
*ppTsdb = NULL;
|
*ppTsdb = NULL;
|
||||||
slen = TD_PATH_MAX; //strlen(pVnode->path) + strlen(dir) + 3;
|
slen = strlen(pVnode->path) + strlen(dir) + 3;
|
||||||
|
|
||||||
// if (slen > TD_PATH_MAX) {
|
if (slen > TD_PATH_MAX) {
|
||||||
// terrno = TSDB_CODE_OUT_OF_RANGE;
|
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,
|
tsdbError("vgId:%d, tsdb open failed since %s, path: %s%s%s", TD_VID(pVnode), terrstr(), pVnode->path, TD_DIRSEP,
|
||||||
// dir);
|
dir);
|
||||||
// return -1;
|
return -1;
|
||||||
// }
|
}
|
||||||
|
|
||||||
// create handle
|
// create handle
|
||||||
pTsdb = (STsdb *)taosMemoryCalloc(1, sizeof(*pTsdb) + slen);
|
pTsdb = (STsdb *)taosMemoryCalloc(1, sizeof(*pTsdb) + slen);
|
||||||
|
|
Loading…
Reference in New Issue