Browse Source

Fix konfd sequences enumeration.

git-svn-id: https://klish.googlecode.com/svn/trunk@479 0eaa4687-2ee9-07dd-09d9-bcdd2d2dd5fb
Serj Kalichev 13 years ago
parent
commit
8dbeed3251
3 changed files with 5 additions and 4 deletions
  1. 1 1
      bin/konf.c
  2. 2 2
      konf/query/query_dump.c
  3. 2 1
      konf/tree/tree.c

+ 1 - 1
bin/konf.c

@@ -119,7 +119,7 @@ int main(int argc, char **argv)
 		goto err;
 	}
 #ifdef DEBUG
-	printf("REQUEST: %s\n", line);
+	fprintf(stderr, "REQUEST: %s\n", line);
 #endif
 
 	if (!(client = konf_client_new(socket_path))) {

+ 2 - 2
konf/query/query_dump.c

@@ -34,8 +34,8 @@ void konf_query_dump(konf_query_t *this)
 	}
 	lub_dump_printf("operation : %s\n", op);
 	lub_dump_printf("pattern   : %s\n", this->pattern);
-	lub_dump_printf("priority  : %u\n", this->priority);
-	lub_dump_printf("sequence  : %u\n", this->seq);
+	lub_dump_printf("priority  : 0x%x\n", this->priority);
+	lub_dump_printf("sequence  : %u\n", this->seq ? "true" : "false");
 	lub_dump_printf("seq_num   : %u\n", this->seq_num);
 	lub_dump_printf("line      : %s\n", this->line);
 	lub_dump_printf("path      : %s\n", this->path);

+ 2 - 1
konf/tree/tree.c

@@ -166,7 +166,8 @@ static int normalize_seq(konf_tree_t * this, unsigned short priority,
 		iter = start;
 		if ((prev = lub_list_node__get_prev(iter))) {
 			conf = (konf_tree_t *)lub_list_node__get_data(prev);
-			cnt = konf_tree__get_seq_num(conf) + 1;
+			if (konf_tree__get_priority(conf) == priority)
+				cnt = konf_tree__get_seq_num(conf) + 1;
 		}
 	} else {
 		iter = lub_list__get_head(this->list);