diff --git a/daemon/main.c b/daemon/main.c index 286063409..ff5a9fef8 100644 --- a/daemon/main.c +++ b/daemon/main.c @@ -135,7 +135,6 @@ struct interface_config_callback_arg { static void sighandler(gpointer x) { sigset_t ss; int ret; - struct timespec ts; sigemptyset(&ss); sigaddset(&ss, SIGINT); @@ -144,12 +143,9 @@ static void sighandler(gpointer x) { sigaddset(&ss, SIGUSR1); sigaddset(&ss, SIGUSR2); - ts.tv_sec = thread_sleep_time / 1000; - ts.tv_nsec = (thread_sleep_time % 1000) * 1000 * 1000; - while (!rtpe_shutdown) { thread_cancel_enable(); - ret = sigtimedwait(&ss, NULL, &ts); + ret = sigwaitinfo(&ss, NULL); thread_cancel_disable(); if (ret == -1) { diff --git a/lib/auxlib.h b/lib/auxlib.h index 9e28bc6ee..fb4ecd3f3 100644 --- a/lib/auxlib.h +++ b/lib/auxlib.h @@ -192,7 +192,7 @@ INLINE int __cond_timedwait_tv(cond_t *c, mutex_t *m, int64_t tv) { #ifndef ASAN_BUILD #define thread_cancel_enable() pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL) #define thread_cancel_disable() pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, NULL) -#define thread_sleep_time 10000 /* ms */ +#define thread_sleep_time -1 // forever #define thread_cleanup_push pthread_cleanup_push #define thread_cleanup_pop pthread_cleanup_pop #else