X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=src%2Fthread%2Fpthread_sigmask.c;h=f188782a3277ed6dbcadb1cb8b8af90dc73efbdd;hb=c5f4b2dfea320356f69445dc1adf8f73596a3c36;hp=f6102ad4dc6b76eb79c19a46a9828f76266e5c81;hpb=400c5e5c8307a2ebe44ef1f203f5a15669f20347;p=musl diff --git a/src/thread/pthread_sigmask.c b/src/thread/pthread_sigmask.c index f6102ad4..f188782a 100644 --- a/src/thread/pthread_sigmask.c +++ b/src/thread/pthread_sigmask.c @@ -1,13 +1,12 @@ #include #include -#include #include "syscall.h" int pthread_sigmask(int how, const sigset_t *restrict set, sigset_t *restrict old) { int ret; - if ((unsigned)how - SIG_BLOCK > 2U) return EINVAL; - ret = -__syscall(SYS_rt_sigprocmask, how, set, old, __SYSCALL_SSLEN); + if (set && (unsigned)how - SIG_BLOCK > 2U) return EINVAL; + ret = -__syscall(SYS_rt_sigprocmask, how, set, old, _NSIG/8); if (!ret && old) { if (sizeof old->__bits[0] == 8) { old->__bits[0] &= ~0x380000000ULL;