From: Samuel Thibault Date: Fri, 30 Mar 2018 00:45:01 +0000 (+0200) Subject: hurd: avoid letting signals go to thread created by timer_create X-Git-Tag: glibc-2.28~421 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=03e2aa50fd512449025bba8c244d16338d8526a4;p=thirdparty%2Fglibc.git hurd: avoid letting signals go to thread created by timer_create * sysdeps/pthread/timer_routines.c (__timer_thread_start): Block all signals in thread created for runing timers. --- diff --git a/ChangeLog b/ChangeLog index fff94307cad..55eec1b939b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2018-04-02 Samuel Thibault + + * sysdeps/pthread/timer_routines.c (__timer_thread_start): Block all + signals in thread created for runing timers. + 2018-04-01 Florian Weimer * support/support_format_addrinfo.c (support_format_addrinfo): diff --git a/sysdeps/pthread/timer_routines.c b/sysdeps/pthread/timer_routines.c index e6e884f53ee..25ccfadd7e1 100644 --- a/sysdeps/pthread/timer_routines.c +++ b/sysdeps/pthread/timer_routines.c @@ -463,10 +463,14 @@ int __timer_thread_start (struct thread_node *thread) { int retval = 1; + sigset_t set, oset; assert (!thread->exists); thread->exists = 1; + sigfillset (&set); + pthread_sigmask (SIG_SETMASK, &set, &oset); + if (pthread_create (&thread->id, &thread->attr, (void *(*) (void *)) thread_func, thread) != 0) { @@ -474,6 +478,8 @@ __timer_thread_start (struct thread_node *thread) retval = -1; } + pthread_sigmask (SIG_SETMASK, &oset, NULL); + return retval; }