diff --git a/src/controller/myconf.c b/src/controller/myconf.c index 33c04e1..662eb61 100644 --- a/src/controller/myconf.c +++ b/src/controller/myconf.c @@ -139,17 +139,17 @@ int load_cluster_config(cluster_t* c, cluster_config_t* get_default_conf(void* cl) { - cluster_t* cls = (cluster_t*)cl; - struct cluster_configuration* cf = NULL; + cluster_t* cls = (cluster_t*)cl; + cluster_config_t* cfg = NULL; - if (load_cluster_config(cls, &cf) != 0 || cf == NULL) { - PERROR("load_cluster_config"); + int rc = load_cluster_config_from_file(cls->myconf->conffile, &cfg); + if (rc < 0 || cfg == NULL) { + PERROR("load_cluster_config_from_file"); return NULL; } - cluster_config_t *result = cf->cluster; - free(cf); /* free the wrapper; result (cf->cluster) is caller-owned */ - return result; + fill_default_cluster_config(cfg); + return cfg; } /* ── load_primary_config ────────────────────────── */