From 068302b7bc1b7c4736aa3a9f74e6aae229cda3b8 Mon Sep 17 00:00:00 2001 From: Federico Di Pierro Date: Tue, 10 Nov 2015 11:36:55 +0100 Subject: [PATCH] even better --- src/worker_thread.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/worker_thread.c b/src/worker_thread.c index 51d78b0..7c36738 100644 --- a/src/worker_thread.c +++ b/src/worker_thread.c @@ -19,7 +19,7 @@ static void sig_handler(int signum); static pthread_t worker_th; static thread_job_list *current_th; // current_th: ptr to latest elem in thread_l list -static struct thread_mesg thread_m = {"", INFO_LINE}; +static struct thread_mesg thread_m; /* * Creates a new job object for the worker_thread appending it to the end of job's queue. @@ -74,6 +74,8 @@ void init_thread(int type, int (* const f)(void)) { inhibit_suspend(); } #endif + thread_m.str = ""; + thread_m.line = INFO_LINE; pthread_create(&worker_th, NULL, execute_thread, NULL); } } @@ -132,8 +134,6 @@ static void *execute_thread(void *x) { return execute_thread(NULL); } num_of_jobs = 0; - thread_m.str = ""; - thread_m.line = INFO_LINE; print_info("", ASK_LINE); #ifdef SYSTEMD_PRESENT if (config.inhibit) {