summaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'main.c')
-rw-r--r--main.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/main.c b/main.c
index 5296171..148b2d2 100644
--- a/main.c
+++ b/main.c
@@ -129,10 +129,9 @@ cfg_init(int argc, char **argv)
unsigned i;
cfg = zmalloc(sizeof(*cfg));
- if (!cfg) {
- perror("malloc");
- return NULL;
- }
+ if (!cfg)
+ perrordie("malloc");
+
uring_task_init(&cfg->task, "cfg", NULL, cfg_free);
list_init(&cfg->servers);
@@ -220,9 +219,12 @@ dump_tree(struct cfg *cfg)
{
struct server *server;
- fprintf(stderr, "\n\n\n\n");
- fprintf(stderr, "Dumping Tree\n");
- fprintf(stderr, "============\n");
+ if (!debug_enabled(DBG_REF))
+ return;
+
+ debug(DBG_REF, "\n\n\n\n");
+ debug(DBG_REF, "Dumping Tree\n");
+ debug(DBG_REF, "============\n");
uring_task_refdump(&cfg->task);
uring_refdump(cfg->uev);
if (cfg->sev)
@@ -233,8 +235,8 @@ dump_tree(struct cfg *cfg)
cfgdir_refdump(cfg->iev);
list_for_each_entry(server, &cfg->servers, list)
server_refdump(server);
- fprintf(stderr, "============\n");
- fprintf(stderr, "\n\n\n\n");
+ debug(DBG_REF, "============\n");
+ debug(DBG_REF, "\n\n\n\n");
}
static void