From 72aa8e7b1d234b6b68446d42efa1cff22b70c81b Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Sun, 6 Jan 2013 03:16:08 -0500 Subject: Refactor sysdb initialization Change the way sysdbs are initialized. Make callers responsible for providing the list of domains. Remove the returned array of sysdb contexts, it was used only by sss_cache and not really necessary there either as that tool can easily iterate the domains. Make sysdb ctx children of their respective domains. Neither sysdb context nor domains are ever freed until a program is done so there shouldn't be any memory hierarchy issue. As plus we simplify the code by removing a destructor and a setter function. --- src/monitor/monitor.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/monitor/monitor.c') diff --git a/src/monitor/monitor.c b/src/monitor/monitor.c index 1fa1592a..2b699ca7 100644 --- a/src/monitor/monitor.c +++ b/src/monitor/monitor.c @@ -2110,7 +2110,6 @@ int monitor_process_init(struct mt_ctx *ctx, const char *config_file) { TALLOC_CTX *tmp_ctx; - struct sysdb_ctx_list *db_list; struct tevent_signal *tes; struct sss_domain_info *dom; char *rcachedir; @@ -2212,7 +2211,7 @@ int monitor_process_init(struct mt_ctx *ctx, if (!tmp_ctx) { return ENOMEM; } - ret = sysdb_init(tmp_ctx, ctx->cdb, NULL, true, &db_list); + ret = sysdb_init(tmp_ctx, ctx->domains, NULL, true); if (ret != EOK) { SYSDB_VERSION_ERROR_DAEMON(ret); return ret; -- cgit