From: Robert Spalek Date: Sun, 23 Apr 2006 13:00:22 +0000 (+0200) Subject: conf2: fix commit hooks X-Git-Tag: holmes-import~645^2~11^2~65 X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=8188ec7d7f7a806adf458a85d6099d0a1d3273ec;p=libucw.git conf2: fix commit hooks --- 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);