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:
guanyi 2023-07-03 16:27:59 +08:00 committed by Xiang Xiao
parent f8ce0cd4ca
commit 55a727b1ce
2 changed files with 25 additions and 1 deletions

View file

@ -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;
}

View file

@ -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);