para_write: Make loglevel work again.
authorAndre Noll <maan@systemlinux.org>
Tue, 5 Jan 2010 05:06:27 +0000 (06:06 +0100)
committerAndre Noll <maan@systemlinux.org>
Tue, 5 Jan 2010 05:06:27 +0000 (06:06 +0100)
Also kill some useless log messagess and fix a memory leak.

write.c

diff --git a/write.c b/write.c
index f79daf2..4d06e80 100644 (file)
--- a/write.c
+++ b/write.c
@@ -284,6 +284,7 @@ static int main_btr(struct sched *s)
        struct check_wav_task_btr _cwt, *cwt = &_cwt;
        struct writer_node **wns;
 
+       loglevel = get_loglevel_by_name(conf.loglevel_arg);
        sit.btrn = btr_new_node("stdin", NULL /* stdin has no parent */, NULL, NULL);
        stdin_set_defaults(&sit);
        register_task(&sit.task);
@@ -296,8 +297,6 @@ static int main_btr(struct sched *s)
        cwt->task.error = 0;
        register_task(&cwt->task);
 
-       PARA_CRIT_LOG("writers:\n");
-
        ret = -E_WRITE_SYNTAX;
        if (!conf.writer_given) {
                i = 0;
@@ -309,7 +308,6 @@ static int main_btr(struct sched *s)
        } else {
                wns = para_malloc(conf.writer_given * sizeof(*wns));
                for (i = 0; i < conf.writer_given; i++) {
-                       PARA_CRIT_LOG("i: %d\n", i);
                        wns[i] = setup_writer_node(conf.writer_arg[i],
                                cwt->btrn);
                        if (!wns[i])
@@ -331,6 +329,7 @@ out:
                free(wn);
        }
        free(wns);
+       btr_free_node(cwt->btrn);
        return ret;
 }