diff options
| author | Jafar Al-Gharaibeh <jafar@atcorp.com> | 2025-02-11 20:53:07 -0600 | 
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-02-11 20:53:07 -0600 | 
| commit | d15d7097d0bfdb6f987e3b5ce9ede8b352267071 (patch) | |
| tree | 1162a6e7159987ac7fccecf3c83514366f0f83a3 /lib/frr_pthread.c | |
| parent | 11a65e1e00e5e80eb39a40c567b1440c07bcf554 (diff) | |
| parent | fd04241d7ea13ca9a009d398c83cf4177871def7 (diff) | |
Merge pull request #18104 from FRRouting/mergify/bp/stable/10.0/pr-18060
lib: crash handlers must be allowed on threads (backport #18060)
Diffstat (limited to 'lib/frr_pthread.c')
| -rw-r--r-- | lib/frr_pthread.c | 8 | 
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/frr_pthread.c b/lib/frr_pthread.c index 1ffa5934aa..a56924eb65 100644 --- a/lib/frr_pthread.c +++ b/lib/frr_pthread.c @@ -20,6 +20,7 @@  #include "zlog.h"  #include "libfrr.h"  #include "libfrr_trace.h" +#include "sigevent.h"  DEFINE_MTYPE_STATIC(LIB, FRR_PTHREAD, "FRR POSIX Thread");  DEFINE_MTYPE_STATIC(LIB, PTHREAD_PRIM, "POSIX sync primitives"); @@ -155,10 +156,9 @@ int frr_pthread_run(struct frr_pthread *fpt, const pthread_attr_t *attr)  	assert(frr_is_after_fork || !"trying to start thread before fork()"); -	/* Ensure we never handle signals on a background thread by blocking -	 * everything here (new thread inherits signal mask) -	 */ -	sigfillset(&blocksigs); +	sigemptyset(&blocksigs); +	frr_sigset_add_mainonly(&blocksigs); +	/* new thread inherits mask */  	pthread_sigmask(SIG_BLOCK, &blocksigs, &oldsigs);  	frrtrace(1, frr_libfrr, frr_pthread_run, fpt->name);  | 
