]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
See if we can fix rlm_sigtran mucking with SIGCHLD
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Fri, 10 Sep 2021 19:12:40 +0000 (14:12 -0500)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Fri, 10 Sep 2021 19:13:55 +0000 (14:13 -0500)
src/modules/rlm_sigtran/event.c

index b3c1211369802db06ea3ab76908cf0f90cb0bd1b..a887c59bc9eb303fb2352966c6184cfbdc4cef8b 100644 (file)
@@ -65,6 +65,7 @@
 #include <freeradius-devel/io/schedule.h>
 #include <unistd.h>
 #include <semaphore.h>
+#include <signal.h>
 
 #include <osmocom/core/logging.h>
 #include <osmocom/sccp/sccp_types.h>
@@ -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;