mirror of
https://github.com/apache/nuttx.git
synced 2026-05-20 04:16:35 +08:00
ltp: sigprocmask fix
1. change signal/sig_procmask.c and pthread/pthread_sigmask.c together 2. clear signals unconditionally Signed-off-by: guanyi <guanyi@xiaomi.com>
This commit is contained in:
@@ -64,6 +64,19 @@
|
||||
|
||||
int pthread_sigmask(int how, FAR const sigset_t *set, FAR sigset_t *oset)
|
||||
{
|
||||
int ret = nxsig_procmask(how, set, oset);
|
||||
sigset_t nset;
|
||||
int ret;
|
||||
|
||||
/* SIGKILL and SIGSTOP should not be added to signal mask */
|
||||
|
||||
if (set != NULL)
|
||||
{
|
||||
nset = *set;
|
||||
nxsig_delset(&nset, SIGKILL);
|
||||
nxsig_delset(&nset, SIGSTOP);
|
||||
set = &nset;
|
||||
}
|
||||
|
||||
ret = nxsig_procmask(how, set, oset);
|
||||
return ret < 0 ? -ret : OK;
|
||||
}
|
||||
|
||||
@@ -187,8 +187,19 @@ int nxsig_procmask(int how, FAR const sigset_t *set, FAR sigset_t *oset)
|
||||
|
||||
int sigprocmask(int how, FAR const sigset_t *set, FAR sigset_t *oset)
|
||||
{
|
||||
sigset_t nset;
|
||||
int ret;
|
||||
|
||||
/* SIGKILL and SIGSTOP should not be added to signal mask */
|
||||
|
||||
if (set != NULL)
|
||||
{
|
||||
nset = *set;
|
||||
nxsig_delset(&nset, SIGKILL);
|
||||
nxsig_delset(&nset, SIGSTOP);
|
||||
set = &nset;
|
||||
}
|
||||
|
||||
/* Let nxsig_procmask do all of the work */
|
||||
|
||||
ret = nxsig_procmask(how, set, oset);
|
||||
|
||||
Reference in New Issue
Block a user