diff --git a/src/client/src/tscSystem.c b/src/client/src/tscSystem.c index 67aa59a64928b6962110c6926045e94bf1c3c365..b1b615ff4ea303161e71029a765bef762f322559 100644 --- a/src/client/src/tscSystem.c +++ b/src/client/src/tscSystem.c @@ -439,40 +439,29 @@ int taos_options(TSDB_OPTION option, const void *arg, ...) { } #include "cJSON.h" -typedef struct retMsg{ - int ret; - char *msg; -} retMsg; - -static retMsg taos_set_config_imp(const char *config){ - retMsg ret = {0, "success"}; - +static int taos_set_config_imp(const char *config){ static bool setConfFlag = false; if (setConfFlag) { tscError("already set config"); - ret.msg = "already set config"; - return ret; + return -1; } cJSON *root = cJSON_Parse(config); if (root == NULL) { tscError("failed to set config, invalid json format: %s", config); - ret.ret = -1; - ret.msg = "invalid json format"; - return ret; + return -1; } + int ret = 0; int size = cJSON_GetArraySize(root); for(int i = 0; i < size; i++){ cJSON *item = cJSON_GetArrayItem(root, i); if (!item) { tscError("failed to read index:%d", i); - ret.ret = -2; - ret.msg = "part config failed, please see the log"; + ret = -2; continue; } if(!taosReadConfigOption(item->string, item->valuestring, NULL, NULL)){ - ret.ret = -2; - ret.msg = "part config failed, please see the log"; + ret = -2; } } taosPrintGlobalCfg();