From 8188ec7d7f7a806adf458a85d6099d0a1d3273ec Mon Sep 17 00:00:00 2001 From: Robert Spalek Date: Sun, 23 Apr 2006 15:00:22 +0200 Subject: [PATCH] conf2: fix commit hooks --- lib/conf2.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/lib/conf2.c b/lib/conf2.c index e8533596..c8b6d315 100644 --- a/lib/conf2.c +++ b/lib/conf2.c @@ -244,14 +244,20 @@ commit_section(byte *name, struct cf_section *sec, void *ptr) { struct cf_item *ci; for (ci=sec->cfg; ci->cls; ci++) - if (ci->cls == CC_SECTION) - if (commit_section(ci->name, ci->u.sec, ptr + (addr_int_t) ci->ptr)) + if (ci->cls == CC_SECTION) { + if (commit_section(ci->name, ci->u.sec, ptr + (addr_int_t) ci->ptr)) { + if (sec != §ions) + log(L_ERROR, "It was in section %s", name); return 1; - else if (ci->cls == CC_LIST) { + } + } else if (ci->cls == CC_LIST) { struct cnode *n; + uns idx = 0; CLIST_WALK(n, * (clist*) (ptr + (addr_int_t) ci->ptr)) - if (commit_section(ci->name, ci->u.sec, n)) + if (idx++, commit_section(ci->name, ci->u.sec, n)) { + log(L_ERROR, "It was in the node #%d of list %s", idx, name); return 1; + } } if (sec->commit) { byte *msg = sec->commit(ptr); -- 2.39.2