diff options
author | Rich Felker <dalias@aerifal.cx> | 2011-07-30 21:09:14 -0400 |
---|---|---|
committer | Rich Felker <dalias@aerifal.cx> | 2011-07-30 21:09:14 -0400 |
commit | ad5881842eaa6a04fcb35b822b0a046a3f7e73a2 (patch) | |
tree | 1d0ac5c3fe5d44da05a805dd6cf0c6db0c9c115c /src/signal/sigprocmask.c | |
parent | 544ee752cd38febfa3aa3798b4dfb6fabd13846b (diff) | |
download | musl-ad5881842eaa6a04fcb35b822b0a046a3f7e73a2.tar.gz |
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.
Diffstat (limited to 'src/signal/sigprocmask.c')
-rw-r--r-- | src/signal/sigprocmask.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/src/signal/sigprocmask.c b/src/signal/sigprocmask.c index 3f003afb..67e2b82e 100644 --- a/src/signal/sigprocmask.c +++ b/src/signal/sigprocmask.c @@ -1,14 +1,10 @@ #include <signal.h> #include <errno.h> -#include "syscall.h" -#include "libc.h" -#include "pthread_impl.h" int sigprocmask(int how, const sigset_t *set, sigset_t *old) { - if (how > 2U) { - errno = EINVAL; - return -1; - } - return syscall(SYS_rt_sigprocmask, how, set, old, 8); + int r = pthread_sigmask(how, set, old); + if (!r) return r; + errno = r; + return -1; } |