From: Arran Cudbard-Bell Date: Fri, 10 Sep 2021 19:12:40 +0000 (-0500) Subject: See if we can fix rlm_sigtran mucking with SIGCHLD X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=192671930d0a5e596ca3ee8daf9c7e66d1c58a22;p=thirdparty%2Ffreeradius-server.git See if we can fix rlm_sigtran mucking with SIGCHLD --- diff --git a/src/modules/rlm_sigtran/event.c b/src/modules/rlm_sigtran/event.c index b3c1211369..a887c59bc9 100644 --- a/src/modules/rlm_sigtran/event.c +++ b/src/modules/rlm_sigtran/event.c @@ -65,6 +65,7 @@ #include #include #include +#include #include #include @@ -523,6 +524,11 @@ static void *sigtran_event_loop(UNUSED void *instance) */ int sigtran_event_start(void) { + sigset_t sigmask; + + sigemptyset(&sigmask); + sigaddset(&sigmask, SIGCHLD); + sem_init(&event_thread_running, 0, 0); if (sigtran_sccp_global_init() < 0) { @@ -530,6 +536,16 @@ int sigtran_event_start(void) return -1; } + /* + * Reset the signal mask some of the + * osmocom code seems to mess with it. + * + * This is so that old Linux kernels + * and libkqueue posix/proc work + * correctly. + */ + pthread_sigmask(SIG_BLOCK, &sigmask, NULL); + if (fr_schedule_pthread_create(&event_thread, sigtran_event_loop, NULL) < 0) { ERROR("main thread - Failed spawning thread for multiplexer event loop: %s", fr_syserror(errno)); return -1;