about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/signal/sigprocmask.c12
-rw-r--r--src/thread/pthread_sigmask.c6
2 files changed, 7 insertions, 11 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;
 }
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 <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);
 }