summaryrefslogtreecommitdiff
path: root/lib/libc
diff options
context:
space:
mode:
authorKonstantin Belousov <kib@FreeBSD.org>2010-07-19 12:41:05 +0000
committerKonstantin Belousov <kib@FreeBSD.org>2010-07-19 12:41:05 +0000
commit9ea6d27829195a1d629d8b302afdbaf50237114b (patch)
treea67cea5be817e75d7485b180481c90053638b644 /lib/libc
parent7be00d5807ff857724f61c50a53b0147d0ef694d (diff)
Notes
Diffstat (limited to 'lib/libc')
-rw-r--r--lib/libc/compat-43/sigcompat.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/lib/libc/compat-43/sigcompat.c b/lib/libc/compat-43/sigcompat.c
index c3ba30a41f40..6841eeb24615 100644
--- a/lib/libc/compat-43/sigcompat.c
+++ b/lib/libc/compat-43/sigcompat.c
@@ -35,6 +35,7 @@ __FBSDID("$FreeBSD$");
#include "namespace.h"
#include <sys/param.h>
+#include <errno.h>
#include <signal.h>
#include <string.h>
#include "un-namespace.h"
@@ -111,9 +112,16 @@ int
xsi_sigpause(int sig)
{
sigset_t set;
+ int error;
- sigemptyset(&set);
- sigaddset(&set, sig);
+ if (!_SIG_VALID(sig)) {
+ errno = EINVAL;
+ return (-1);
+ }
+ error = _sigprocmask(SIG_BLOCK, NULL, &set);
+ if (error != 0)
+ return (error);
+ sigdelset(&set, sig);
return (_sigsuspend(&set));
}