]> mj.ucw.cz Git - libucw.git/commitdiff
conf2: fix commit hooks
authorRobert Spalek <robert@ucw.cz>
Sun, 23 Apr 2006 13:00:22 +0000 (15:00 +0200)
committerRobert Spalek <robert@ucw.cz>
Sun, 23 Apr 2006 13:00:22 +0000 (15:00 +0200)
lib/conf2.c

index e8533596eb48973617d8a804ca6c507eb9f36808..c8b6d3153b12b722329ad4e8d7ed8e811879e20a 100644 (file)
@@ -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 != &sections)
+         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);