From 276eb84746dba3ae8e0d157e6daa77fe47b91927 Mon Sep 17 00:00:00 2001 From: afwerar <1296468573@qq.com> Date: Mon, 25 Apr 2022 14:05:09 +0800 Subject: [PATCH] feature(dnode): mul parameter start. --- include/common/tglobal.h | 4 ++-- source/client/src/clientEnv.c | 4 ++-- source/common/src/tglobal.c | 4 ++-- source/dnode/mgmt/exe/dmMain.c | 4 ++-- source/libs/function/src/udfd.c | 4 ++-- source/libs/function/test/runUdf.c | 4 ++-- tests/tsim/src/simSystem.c | 4 ++-- 7 files changed, 14 insertions(+), 14 deletions(-) diff --git a/include/common/tglobal.h b/include/common/tglobal.h index cde423c3cd..fc3d575317 100644 --- a/include/common/tglobal.h +++ b/include/common/tglobal.h @@ -123,9 +123,9 @@ extern SDiskCfg tsDiskCfg[]; #define NEEDTO_COMPRESSS_MSG(size) (tsCompressMsgSize != -1 && (size) > tsCompressMsgSize) -int32_t taosCreateLog(const char *logname, int32_t logFileNum, const char **envCmd, const char *cfgDir, const char *envFile, +int32_t taosCreateLog(const char *logname, int32_t logFileNum, const char *cfgDir, const char **envCmd, const char *envFile, char *apolloUrl, SArray *pArgs, bool tsc); -int32_t taosInitCfg(const char **envCmd, const char *cfgDir, const char *envFile, char *apolloUrl, SArray *pArgs, bool tsc); +int32_t taosInitCfg(const char *cfgDir, const char **envCmd, const char *envFile, char *apolloUrl, SArray *pArgs, bool tsc); void taosCleanupCfg(); void taosCfgDynamicOptions(const char *option, const char *value); void taosAddDataDir(int32_t index, char *v1, int32_t level, int32_t primary); diff --git a/source/client/src/clientEnv.c b/source/client/src/clientEnv.c index 56eab18a55..596c3d3fbf 100644 --- a/source/client/src/clientEnv.c +++ b/source/client/src/clientEnv.c @@ -254,12 +254,12 @@ void taos_init_imp(void) { deltaToUtcInitOnce(); - if (taosCreateLog("taoslog", 10, NULL, configDir, NULL, NULL, NULL, 1) != 0) { + if (taosCreateLog("taoslog", 10, configDir, NULL, NULL, NULL, NULL, 1) != 0) { tscInitRes = -1; return; } - if (taosInitCfg(NULL, configDir, NULL, NULL, NULL, 1) != 0) { + if (taosInitCfg(configDir, NULL, NULL, NULL, NULL, 1) != 0) { tscInitRes = -1; return; } diff --git a/source/common/src/tglobal.c b/source/common/src/tglobal.c index c74f53f0a0..bbf14b2fdc 100644 --- a/source/common/src/tglobal.c +++ b/source/common/src/tglobal.c @@ -579,7 +579,7 @@ static int32_t taosSetServerCfg(SConfig *pCfg) { return 0; } -int32_t taosCreateLog(const char *logname, int32_t logFileNum, const char **envCmd, const char *cfgDir, const char *envFile, +int32_t taosCreateLog(const char *logname, int32_t logFileNum, const char *cfgDir, const char **envCmd, const char *envFile, char *apolloUrl, SArray *pArgs, bool tsc) { osDefaultInit(); @@ -632,7 +632,7 @@ int32_t taosCreateLog(const char *logname, int32_t logFileNum, const char **envC return 0; } -int32_t taosInitCfg(const char **envCmd, const char *cfgDir, const char *envFile, char *apolloUrl, SArray *pArgs, bool tsc) { +int32_t taosInitCfg(const char *cfgDir, const char **envCmd, const char *envFile, char *apolloUrl, SArray *pArgs, bool tsc) { if (tsCfg != NULL) return 0; tsCfg = cfgInit(); diff --git a/source/dnode/mgmt/exe/dmMain.c b/source/dnode/mgmt/exe/dmMain.c index b85072faf6..43237e6e6c 100644 --- a/source/dnode/mgmt/exe/dmMain.c +++ b/source/dnode/mgmt/exe/dmMain.c @@ -136,7 +136,7 @@ static SDnodeOpt dmGetOpt() { static int32_t dmInitLog() { char logName[12] = {0}; snprintf(logName, sizeof(logName), "%slog", dmLogName(global.ntype)); - return taosCreateLog(logName, 1, global.envCmd, configDir, global.envFile, global.apolloUrl, global.pArgs, 0); + return taosCreateLog(logName, 1, configDir, global.envCmd, global.envFile, global.apolloUrl, global.pArgs, 0); } static void dmSetProcInfo(int32_t argc, char **argv) { @@ -209,7 +209,7 @@ int main(int argc, char const *argv[]) { return -1; } - if (taosInitCfg(global.envCmd, configDir, global.envFile, global.apolloUrl, global.pArgs, 0) != 0) { + if (taosInitCfg(configDir, global.envCmd, global.envFile, global.apolloUrl, global.pArgs, 0) != 0) { dError("failed to start since read config error"); taosCleanupArgs(); return -1; diff --git a/source/libs/function/src/udfd.c b/source/libs/function/src/udfd.c index faea595a42..11bbd6442c 100644 --- a/source/libs/function/src/udfd.c +++ b/source/libs/function/src/udfd.c @@ -548,7 +548,7 @@ static int32_t udfdParseArgs(int32_t argc, char *argv[]) { static int32_t udfdInitLog() { char logName[12] = {0}; snprintf(logName, sizeof(logName), "%slog", "udfd"); - return taosCreateLog(logName, 1, NULL, configDir, NULL, NULL, NULL, 0); + return taosCreateLog(logName, 1, configDir, NULL, NULL, NULL, NULL, 0); } void udfdCtrlAllocBufCb(uv_handle_t *handle, size_t suggested_size, uv_buf_t *buf) { @@ -656,7 +656,7 @@ int main(int argc, char *argv[]) { return -1; } - if (taosInitCfg(NULL, configDir, NULL, NULL, NULL, 0) != 0) { + if (taosInitCfg(configDir, NULL, NULL, NULL, NULL, 0) != 0) { fnError("failed to start since read config error"); return -1; } diff --git a/source/libs/function/test/runUdf.c b/source/libs/function/test/runUdf.c index 9184d3d6e0..a8d6fbd715 100644 --- a/source/libs/function/test/runUdf.c +++ b/source/libs/function/test/runUdf.c @@ -31,13 +31,13 @@ static int32_t parseArgs(int32_t argc, char *argv[]) { static int32_t initLog() { char logName[12] = {0}; snprintf(logName, sizeof(logName), "%slog", "udfc"); - return taosCreateLog(logName, 1, NULL, configDir, NULL, NULL, NULL, 0); + return taosCreateLog(logName, 1, configDir, NULL, NULL, NULL, NULL, 0); } int main(int argc, char *argv[]) { parseArgs(argc, argv); initLog(); - if (taosInitCfg(NULL, configDir, NULL, NULL, NULL, 0) != 0) { + if (taosInitCfg(configDir, NULL, NULL, NULL, NULL, 0) != 0) { fnError("failed to start since read config error"); return -1; } diff --git a/tests/tsim/src/simSystem.c b/tests/tsim/src/simSystem.c index 57fc7717f5..69f15a164e 100644 --- a/tests/tsim/src/simSystem.c +++ b/tests/tsim/src/simSystem.c @@ -28,8 +28,8 @@ char simScriptDir[PATH_MAX] = {0}; extern bool simExecSuccess; int32_t simInitCfg() { - taosCreateLog("simlog", 1, NULL, configDir, NULL, NULL, NULL, 1); - taosInitCfg(NULL, configDir, NULL, NULL, NULL, 1); + taosCreateLog("simlog", 1, configDir, NULL, NULL, NULL, NULL, 1); + taosInitCfg(configDir, NULL, NULL, NULL, NULL, 1); SConfig *pCfg = taosGetCfg(); simDebugFlag = cfgGetItem(pCfg, "simDebugFlag")->i32; -- GitLab