From 5cef60e29c23554a02efc061dca0812b8a08a1e9 Mon Sep 17 00:00:00 2001 From: Leah Neukirchen Date: Thu, 6 Jan 2022 21:43:35 +0100 Subject: block all signals in helper threads --- rvnit.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/rvnit.c b/rvnit.c index e01992d..7e03bc6 100644 --- a/rvnit.c +++ b/rvnit.c @@ -485,8 +485,14 @@ main() fcntl(newlogfd[1], F_SETFD, FD_CLOEXEC); main_thread = pthread_self(); + + /* block all signals in the threads */ + sigset_t allset; + sigfillset(&allset); + sigprocmask(SIG_BLOCK, &allset, 0); pthread_create(&socket_thread, 0, socket_loop, 0); pthread_create(&logger_thread, 0, logger_loop, 0); + sigprocmask(SIG_UNBLOCK, &allset, 0); if (chdir("sv") < 0) { perror("chdir"); -- cgit 1.4.1