From ad5881842eaa6a04fcb35b822b0a046a3f7e73a2 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Sat, 30 Jul 2011 21:09:14 -0400 Subject: 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. --- src/thread/pthread_sigmask.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/thread/pthread_sigmask.c') diff --git a/src/thread/pthread_sigmask.c b/src/thread/pthread_sigmask.c index 6cc21d22..60a440b4 100644 --- a/src/thread/pthread_sigmask.c +++ b/src/thread/pthread_sigmask.c @@ -1,10 +1,10 @@ #include #include #include +#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); } -- cgit v1.2.1