sched: Fix tg_flags check with GROUP_FLAG_NOCLDWAIT

Jira: PDFW15IS-208
Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
This commit is contained in:
Nobutaka Toyoshima 2017-04-14 14:29:47 +09:00 committed by Masayuki Ishikawa
parent 4489d3bdca
commit 150036eb8b
4 changed files with 7 additions and 7 deletions

View File

@ -204,7 +204,7 @@ int waitid(idtype_t idtype, id_t id, FAR siginfo_t *info, int options)
#ifdef CONFIG_SCHED_CHILD_STATUS
/* Does this task retain child status? */
retains = ((rtcb->group->tg_flags && GROUP_FLAG_NOCLDWAIT) == 0);
retains = ((rtcb->group->tg_flags & GROUP_FLAG_NOCLDWAIT) == 0);
if (rtcb->group->tg_children == NULL && retains)
{

View File

@ -346,7 +346,7 @@ pid_t waitpid(pid_t pid, int *stat_loc, int options)
#ifdef CONFIG_SCHED_CHILD_STATUS
/* Does this task retain child status? */
retains = ((rtcb->group->tg_flags && GROUP_FLAG_NOCLDWAIT) == 0);
retains = ((rtcb->group->tg_flags & GROUP_FLAG_NOCLDWAIT) == 0);
if (rtcb->group->tg_children == NULL && retains)
{

View File

@ -163,7 +163,7 @@ int task_reparent(pid_t ppid, pid_t chpid)
{
/* Has the new parent's task group supressed child exit status? */
if ((pgrp->tg_flags && GROUP_FLAG_NOCLDWAIT) == 0)
if ((pgrp->tg_flags & GROUP_FLAG_NOCLDWAIT) == 0)
{
/* No.. Add the child status entry to the new parent's task group */
@ -186,7 +186,7 @@ int task_reparent(pid_t ppid, pid_t chpid)
* suppressed child exit status.
*/
ret = ((ogrp->tg_flags && GROUP_FLAG_NOCLDWAIT) == 0) ? -ENOENT : OK;
ret = ((ogrp->tg_flags & GROUP_FLAG_NOCLDWAIT) == 0) ? -ENOENT : OK;
}
#else /* CONFIG_SCHED_CHILD_STATUS */
@ -276,7 +276,7 @@ int task_reparent(pid_t ppid, pid_t chpid)
{
/* Has the new parent's task group supressed child exit status? */
if ((ptcb->group->tg_flags && GROUP_FLAG_NOCLDWAIT) == 0)
if ((ptcb->group->tg_flags & GROUP_FLAG_NOCLDWAIT) == 0)
{
/* No.. Add the child status entry to the new parent's task group */
@ -299,7 +299,7 @@ int task_reparent(pid_t ppid, pid_t chpid)
* suppressed child exit status.
*/
ret = ((otcb->group->tg_flags && GROUP_FLAG_NOCLDWAIT) == 0) ? -ENOENT : OK;
ret = ((otcb->group->tg_flags & GROUP_FLAG_NOCLDWAIT) == 0) ? -ENOENT : OK;
}
#else /* CONFIG_SCHED_CHILD_STATUS */

View File

@ -237,7 +237,7 @@ static inline void task_saveparent(FAR struct tcb_s *tcb, uint8_t ttype)
* the SA_NOCLDWAIT flag with sigaction().
*/
if ((rtcb->group->tg_flags && GROUP_FLAG_NOCLDWAIT) == 0)
if ((rtcb->group->tg_flags & GROUP_FLAG_NOCLDWAIT) == 0)
{
FAR struct child_status_s *child;