Without this fix, para_client always used loglevel debug.
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]);
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)
};
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);
*
* \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;
&ct->conf, ¶ms))
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);