recv/filter: Init loglevel earlier.
authorAndre Noll <maan@systemlinux.org>
Sun, 5 Jul 2009 21:26:54 +0000 (23:26 +0200)
committerAndre Noll <maan@systemlinux.org>
Sun, 5 Jul 2009 21:26:54 +0000 (23:26 +0200)
This avoids that early debug messages are always printed.

filter.c
recv.c

index b8a7c5c..17b7f2f 100644 (file)
--- a/filter.c
+++ b/filter.c
@@ -121,6 +121,7 @@ static int parse_config(int argc, char *argv[])
        HANDLE_VERSION_FLAG("filter", conf);
        if (conf.help_given || conf.detailed_help_given)
                print_help_and_die();
+       loglevel = get_loglevel_by_name(conf.loglevel_arg);
        if (!cf) {
                char *home = para_homedir();
                cf = make_message("%s/.paraslash/filter.conf", home);
@@ -163,7 +164,6 @@ int main(int argc, char *argv[])
        ret = parse_config(argc, argv);
        if (ret < 0)
                goto out;
-       loglevel = get_loglevel_by_name(conf.loglevel_arg);
        ret = init_filter_chain();
        if (ret < 0)
                goto out;
diff --git a/recv.c b/recv.c
index 5de9c6b..fc34279 100644 (file)
--- a/recv.c
+++ b/recv.c
@@ -52,6 +52,7 @@ static void *parse_config(int argc, char *argv[], int *receiver_num)
        HANDLE_VERSION_FLAG("recv", conf);
        if (conf.help_given || conf.detailed_help_given)
                print_help_and_die();
+       loglevel = get_loglevel_by_name(conf.loglevel_arg);
        return check_receiver_arg(conf.receiver_arg, receiver_num);
 }
 
@@ -86,7 +87,6 @@ int main(int argc, char *argv[])
                PARA_EMERG_LOG("parse failed\n");
                goto out;
        }
-       loglevel = get_loglevel_by_name(conf.loglevel_arg);
        r = &receivers[receiver_num];
        rn.receiver = r;
        ret = r->open(&rn);