From abc17227ab47fcfa522ceb1442bf873fde2edab0 Mon Sep 17 00:00:00 2001 From: Cary Xu Date: Thu, 3 Nov 2022 19:45:14 +0800 Subject: [PATCH] enh: code optimization for PATH_MAX --- source/dnode/vnode/src/tsdb/tsdbOpen.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/source/dnode/vnode/src/tsdb/tsdbOpen.c b/source/dnode/vnode/src/tsdb/tsdbOpen.c index e109edca11..bb20a9b012 100644 --- a/source/dnode/vnode/src/tsdb/tsdbOpen.c +++ b/source/dnode/vnode/src/tsdb/tsdbOpen.c @@ -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); -- GitLab