From 0232747f04b650796db56fd7b487aee8a96fab03 Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Mon, 14 Jan 2013 17:04:00 -0500 Subject: Add function get_next_domain() Use this function instead of explicitly calling domain->next This function allows to get the next primary domain or to descend into the subdomains and replaces also get_next_dom_or_subdom() --- src/monitor/monitor.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/monitor/monitor.c') diff --git a/src/monitor/monitor.c b/src/monitor/monitor.c index 2b699ca7..2c8cdb60 100644 --- a/src/monitor/monitor.c +++ b/src/monitor/monitor.c @@ -772,7 +772,7 @@ static int check_domain_ranges(struct sss_domain_info *domains) uint32_t id_min, id_max; while (dom) { - other = dom->next; + other = get_next_domain(dom, false); if (dom->id_max && dom->id_min > dom->id_max) { DEBUG(SSSDBG_CRIT_FAILURE, ("Domain '%s' does not have a valid ID range\n", dom->name)); @@ -788,9 +788,9 @@ static int check_domain_ranges(struct sss_domain_info *domains) ("Domains '%s' and '%s' overlap in range %u - %u\n", dom->name, other->name, id_min, id_max)); } - other = other->next; + other = get_next_domain(other, false); } - dom = dom->next; + dom = get_next_domain(dom, false); } return EOK; @@ -811,7 +811,7 @@ static int check_local_domain_unique(struct sss_domain_info *domains) break; } - dom = dom->next; + dom = get_next_domain(dom, false); } if (count > 1) { @@ -2235,7 +2235,7 @@ int monitor_process_init(struct mt_ctx *ctx, /* start providers */ num_providers = 0; - for (dom = ctx->domains; dom; dom = dom->next) { + for (dom = ctx->domains; dom; dom = get_next_domain(dom, false)) { ret = add_new_provider(ctx, dom->name, 0); if (ret != EOK && ret != ENOENT) { return ret; -- cgit