mirror of
https://github.com/apache/nuttx.git
synced 2026-05-31 23:40:19 +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
@@ -68,7 +68,7 @@ int nxsig_ismember(FAR const sigset_t *set, int signo)
|
||||
{
|
||||
/* Check if the signal is in the set */
|
||||
|
||||
return ((set->_elem[_SIGSET_NDX(signo)] & _SIGNO2SET(signo)) != 0);
|
||||
return (set->_elem[_SIGSET_NDX(signo)] & _SIGNO2SET(signo)) ? 1 : 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user