mirror of
https://github.com/fluencelabs/musl
synced 2025-06-30 07:02:41 +00:00
clean up pthread_sigmask/sigprocmask dependency order
it's nicer for the function that doesn't use errno to be independent, and have the other one call it. saves some time and avoids clobbering errno.
This commit is contained in:
@ -1,10 +1,10 @@
|
||||
#include <signal.h>
|
||||
#include <errno.h>
|
||||
#include <pthread.h>
|
||||
#include "syscall.h"
|
||||
|
||||
int pthread_sigmask(int how, const sigset_t *set, sigset_t *old)
|
||||
{
|
||||
int ret = sigprocmask(how, set, old);
|
||||
if (ret) return errno;
|
||||
return 0;
|
||||
if (how > 2U) return EINVAL;
|
||||
return -__syscall(SYS_rt_sigprocmask, how, set, old, 8);
|
||||
}
|
||||
|
Reference in New Issue
Block a user