For xsi_sigpause(3), remove the supplied signal from the process mask
during sigpause(2) call. It was backward. Check that the signal number is valid. Reported by: Garrett Cooper <yanegomi gmail com> MFC after: 1 week
This commit is contained in:
parent
160f3477ee
commit
5ebe96648b
@ -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));
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user