mirror of
https://github.com/apache/nuttx.git
synced 2026-05-27 19:36:35 +08:00
sched/signal: Fix nxsig_ismember() return value behavior
Build Documentation / build-html (push) Has been cancelled
Build Documentation / build-html (push) Has been cancelled
nxsig_ismember() has a return type of int, but the current implementation returns a boolean value, which is incorrect. All callers should determine membership by checking whether the return value is 1 or 0, which is also consistent with the POSIX sigismember() API. Signed-off-by: Chengdong Wang wangchengdong@lixiang.com
This commit is contained in:
committed by
Xiang Xiao
parent
817e4ee354
commit
ba05c7f133
@@ -127,7 +127,7 @@ static int group_signal_handler(pid_t pid, FAR void *arg)
|
||||
|
||||
/* Is this signal unblocked on this thread? */
|
||||
|
||||
if (!nxsig_ismember(&tcb->sigprocmask, info->siginfo->si_signo) &&
|
||||
if ((nxsig_ismember(&tcb->sigprocmask, info->siginfo->si_signo) != 1) &&
|
||||
!info->ptcb && tcb != info->atcb)
|
||||
{
|
||||
/* Yes.. remember this TCB if we have not encountered any
|
||||
|
||||
@@ -550,7 +550,7 @@ int nxsig_tcbdispatch(FAR struct tcb_s *stcb, siginfo_t *info,
|
||||
|
||||
if (stcb->task_state == TSTATE_WAIT_SIG &&
|
||||
(masked == 0 ||
|
||||
nxsig_ismember(&stcb->sigwaitmask, info->si_signo)))
|
||||
(nxsig_ismember(&stcb->sigwaitmask, info->si_signo) == 1)))
|
||||
{
|
||||
if (stcb->sigunbinfo != NULL)
|
||||
{
|
||||
|
||||
@@ -50,7 +50,7 @@ int nxsig_lowest(sigset_t *set)
|
||||
|
||||
for (signo = MIN_SIGNO; signo <= MAX_SIGNO; signo++)
|
||||
{
|
||||
if (nxsig_ismember(set, signo))
|
||||
if (nxsig_ismember(set, signo) == 1)
|
||||
{
|
||||
return signo;
|
||||
}
|
||||
|
||||
@@ -419,7 +419,7 @@ int nxsig_timedwait(FAR const sigset_t *set, FAR struct siginfo *info,
|
||||
* that we were waiting for?
|
||||
*/
|
||||
|
||||
if (nxsig_ismember(set, rtcb->sigunbinfo->si_signo))
|
||||
if (nxsig_ismember(set, rtcb->sigunbinfo->si_signo) == 1)
|
||||
{
|
||||
/* Yes.. the return value is the number of the signal that
|
||||
* awakened us.
|
||||
|
||||
Reference in New Issue
Block a user