diff --git a/daemon/helpers.c b/daemon/helpers.c index 447140b18..3656604bf 100644 --- a/daemon/helpers.c +++ b/daemon/helpers.c @@ -47,7 +47,6 @@ static cond_t threads_cond = COND_STATIC_INIT; static mutex_t thread_wakers_lock = MUTEX_STATIC_INIT; static GList *thread_wakers; -volatile int rtpe_shutdown; #ifdef NEED_ATOMIC64_MUTEX mutex_t __atomic64_mutex = MUTEX_STATIC_INIT; diff --git a/daemon/main.c b/daemon/main.c index b68594f39..5f5794796 100644 --- a/daemon/main.c +++ b/daemon/main.c @@ -131,7 +131,7 @@ static void sighandler(gpointer x) { } if (ret == SIGINT || ret == SIGTERM) - rtpe_shutdown = 1; + rtpe_shutdown = true; else if (ret == SIGUSR1) { for (unsigned int i = 0; i < num_log_levels; i++) { g_atomic_int_add(&rtpe_config.common.log_levels[i], -1); diff --git a/include/helpers.h b/include/helpers.h index add4a246f..ac8f1b234 100644 --- a/include/helpers.h +++ b/include/helpers.h @@ -51,13 +51,6 @@ G_STATIC_ASSERT (sizeof *(atomic) == sizeof (gint)); \ -/*** GLOBALS ***/ - -extern volatile int rtpe_shutdown; - - - - /*** PROTOTYPES ***/ typedef int (*parse_func)(char **, void **, void *); diff --git a/lib/auxlib.c b/lib/auxlib.c index b63c3ff78..108cc93b2 100644 --- a/lib/auxlib.c +++ b/lib/auxlib.c @@ -22,6 +22,7 @@ struct thread_buf { static int version; struct rtpengine_common_config *rtpe_common_config_ptr; __thread struct timeval rtpe_now; +volatile bool rtpe_shutdown; static __thread struct thread_buf t_bufs[NUM_THREAD_BUFS]; static __thread int t_buf_idx; diff --git a/lib/auxlib.h b/lib/auxlib.h index fb3e29b28..44cf1de32 100644 --- a/lib/auxlib.h +++ b/lib/auxlib.h @@ -41,7 +41,7 @@ extern struct rtpengine_common_config *rtpe_common_config_ptr; /*** GLOBALS ***/ extern __thread struct timeval rtpe_now; -extern volatile int rtpe_shutdown; +extern volatile bool rtpe_shutdown; diff --git a/lib/poller.c b/lib/poller.c index 4c0b3c4bf..f1782f140 100644 --- a/lib/poller.c +++ b/lib/poller.c @@ -16,6 +16,7 @@ #include "obj.h" #include "log_funcs.h" +#include "auxlib.h"