diff --git a/source/common/src/tglobal.c b/source/common/src/tglobal.c index 84d4e7b7e7..119438fbd6 100644 --- a/source/common/src/tglobal.c +++ b/source/common/src/tglobal.c @@ -1344,7 +1344,10 @@ int32_t taosReadDataFolder(const char *cfgDir, const char **envCmd, const char * return -1; } - tstrncpy(tsDataDir, cfgGetItem(pCfg, "dataDir")->str, PATH_MAX); + if (taosSetTfsCfg(pCfg) != 0) { + cfgCleanup(pCfg); + return -1; + } dDebugFlag = cfgGetItem(pCfg, "dDebugFlag")->i32; cfgCleanup(pCfg); diff --git a/source/dnode/mgmt/exe/dmMain.c b/source/dnode/mgmt/exe/dmMain.c index 65f695cb8b..1c5541de29 100644 --- a/source/dnode/mgmt/exe/dmMain.c +++ b/source/dnode/mgmt/exe/dmMain.c @@ -369,7 +369,7 @@ int mainWindows(int argc, char **argv) { if(global.generateCode) { bool toLogFile = false; if(taosReadDataFolder(configDir, global.envCmd, global.envFile, global.apolloUrl, global.pArgs) != 0){ - encryptError("failed to generate encrypt code since taosd is running, please stop it first"); + encryptError("failed to generate encrypt code since dataDir can not be set from cfg file"); return -1; };