htl: Make __pthread_sigmask directly call __sigthreadmask

If no thread was created yet, __pthread_sigstate will not find our ss
because self->kernel_thread is still nul, and then change the global
sigstate instead of our sigstate! We can directly call __sigthreadmask and
skip the (bogus) lookup step.
This commit is contained in:
Samuel Thibault 2025-03-06 00:14:06 +01:00
parent 7a185eb9e9
commit 81c4ec1ca8
2 changed files with 4 additions and 3 deletions

View File

@ -19,15 +19,14 @@
#include <pthread.h>
#include <signal.h>
#include <shlib-compat.h>
#include <hurd/signal.h>
#include <pt-internal.h>
int
__pthread_sigmask (int how, const sigset_t *set, sigset_t *oset)
{
struct __pthread *self = _pthread_self ();
/* Do not clear SELF's pending signals. */
return __pthread_sigstate (self, how, set, oset, 0);
return __sigthreadmask (_hurd_self_sigstate (), how, set, oset, 0);
}
libc_hidden_def (__pthread_sigmask)
versioned_symbol (libc, __pthread_sigmask, pthread_sigmask, GLIBC_2_41);

View File

@ -36,6 +36,8 @@ __sigthreadmask (struct hurd_sigstate *ss, int how,
new = *set;
assert (ss);
/* We are not supposed to change the global blocked state */
assert (ss != _hurd_global_sigstate);
_hurd_sigstate_lock (ss);