Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ltp: sigprocmask fix #9923

Merged
merged 1 commit into from
Aug 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion sched/pthread/pthread_sigmask.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
11 changes: 11 additions & 0 deletions sched/signal/sig_procmask.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
xiaoxiang781216 marked this conversation as resolved.
Show resolved Hide resolved
Expand Down
Loading