]> git.tue.mpg.de Git - paraslash.git/commitdiff
Fix para_client's --loglevel option.
authorAndre Noll <maan@systemlinux.org>
Sat, 24 Jan 2009 14:08:43 +0000 (15:08 +0100)
committerAndre Noll <maan@systemlinux.org>
Sat, 24 Jan 2009 14:08:43 +0000 (15:08 +0100)
Without this fix, para_client always used loglevel debug.

audiod.c
client.c
client.h
client_common.c

index a92c4e3b1ebca665a3804bc168472673fd733037..dab3e3dad7dfffa3ee5733355489b04f1762a6fa 100644 (file)
--- a/audiod.c
+++ b/audiod.c
@@ -1021,13 +1021,13 @@ static void status_pre_select(struct sched *s, struct task *t)
                int argc = 3;
                PARA_INFO_LOG("clock diff count: %d\n", st->clock_diff_count);
                st->clock_diff_count--;
-               client_open(argc, argv, &st->ct);
+               client_open(argc, argv, &st->ct, NULL);
                set_stat_task_restart_barrier(2);
 
        } else {
                char *argv[] = {"audiod", "stat", NULL};
                int argc = 2;
-               client_open(argc, argv, &st->ct);
+               client_open(argc, argv, &st->ct, NULL);
                set_stat_task_restart_barrier(5);
        }
        free(stat_item_values[SI_BASENAME]);
index fdd07b247e617c86d3f38ff059d8bb8672356a9c..2123421e71b099bb632b99c563aaafd5b0c70aaf 100644 (file)
--- a/client.c
+++ b/client.c
@@ -80,10 +80,9 @@ int main(int argc, char *argv[])
 
        s.default_timeout.tv_sec = 1;
        s.default_timeout.tv_usec = 0;
-       ret = client_open(argc, argv, &ct);
+       ret = client_open(argc, argv, &ct, &client_loglevel);
        if (ret < 0) /* can not use PARA_LOG here because ct is NULL */
                exit(EXIT_FAILURE);
-       client_loglevel = get_loglevel_by_name(ct->conf.loglevel_arg);
        register_task(&svt);
        ret = schedule(&s);
        if (ret < 0)
index b813f186590b3d505ee20187ba050cee38c02c0c..a7a3289b12b3c6acded3b11cd2ecf40d4f69fa6b 100644 (file)
--- a/client.h
+++ b/client.h
@@ -76,4 +76,5 @@ struct client_task {
 };
 
 void client_close(struct client_task *ct);
-int client_open(int argc, char *argv[], struct client_task **ct);
+int client_open(int argc, char *argv[], struct client_task **ct,
+               int *loglevel);
index e757a3a7a954bb6885a61613ce19c7158f96330f..d5807e758d656df802647dd1039286770016ac29 100644 (file)
@@ -319,7 +319,8 @@ err_out:
  *
  * \return Standard.
  */
-int client_open(int argc, char *argv[], struct client_task **ct_ptr)
+int client_open(int argc, char *argv[], struct client_task **ct_ptr,
+               int *loglevel)
 {
        char *home = para_homedir();
        struct stat statbuf;
@@ -363,7 +364,8 @@ int client_open(int argc, char *argv[], struct client_task **ct_ptr)
                        &ct->conf, &params))
                        goto out;
        }
-       ret = 1;
+       if (loglevel)
+               *loglevel = get_loglevel_by_name(ct->conf.loglevel_arg);
        PARA_INFO_LOG("loglevel: %s\n", ct->conf.loglevel_arg);
        PARA_INFO_LOG("config_file: %s\n", ct->config_file);
        PARA_INFO_LOG("key_file: %s\n", ct->key_file);