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/tools/sss_debuglevel.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/tools/sss_debuglevel.c') diff --git a/src/tools/sss_debuglevel.c b/src/tools/sss_debuglevel.c index e955ec38..ce428bd9 100644 --- a/src/tools/sss_debuglevel.c +++ b/src/tools/sss_debuglevel.c @@ -253,8 +253,11 @@ errno_t get_confdb_sections(TALLOC_CTX *ctx, struct confdb_ctx *confdb, if (ret != EOK) DEBUG(SSSDBG_CRIT_FAILURE, ("Unable to get domain list\n")); - for (domain = domain_list; domain != NULL; domain = domain->next) + for (domain = domain_list; + domain; + domain = get_next_domain(domain, false)) { domain_count++; + } /* allocate output space */ sections = talloc_array(ctx, char*, @@ -275,7 +278,9 @@ errno_t get_confdb_sections(TALLOC_CTX *ctx, struct confdb_ctx *confdb, } } - for (domain = domain_list; domain != NULL; domain = domain->next, i++) { + for (domain = domain_list; + domain; + domain = get_next_domain(domain, false), i++) { sections[i] = talloc_asprintf(tmp_ctx, CONFDB_DOMAIN_PATH_TMPL, domain->name); if (sections[i] == NULL) { -- cgit