diff --git a/sched/sched/sched_waitid.c b/sched/sched/sched_waitid.c index 81955e44d15..330f26afec6 100644 --- a/sched/sched/sched_waitid.c +++ b/sched/sched/sched_waitid.c @@ -400,7 +400,7 @@ int waitid(idtype_t idtype, id_t id, FAR siginfo_t *info, int options) { /* Make sure that the thread it is our child. */ - if (ctcb->group->tg_ppid != rtcb->pid) + if (ctcb->group->tg_ppid != rtcb->group->tg_pid) { errcode = ECHILD; } @@ -437,7 +437,8 @@ int waitid(idtype_t idtype, id_t id, FAR siginfo_t *info, int options) ctcb = nxsched_get_tcb((pid_t)id); - if (!ctcb || !ctcb->group || ctcb->group->tg_ppid != rtcb->pid) + if (!ctcb || !ctcb->group || + ctcb->group->tg_ppid != rtcb->group->tg_pid) { errcode = ECHILD; } diff --git a/sched/sched/sched_waitpid.c b/sched/sched/sched_waitpid.c index 49a70fe974d..25e326c36f1 100644 --- a/sched/sched/sched_waitpid.c +++ b/sched/sched/sched_waitpid.c @@ -373,7 +373,8 @@ pid_t nxsched_waitpid(pid_t pid, FAR int *stat_loc, int options) */ ctcb = nxsched_get_tcb(pid); - if (!ctcb || !ctcb->group || ctcb->group->tg_ppid != rtcb->pid || + if (!ctcb || !ctcb->group || + ctcb->group->tg_ppid != rtcb->group->tg_pid || (ctcb->flags & TCB_FLAG_EXIT_PROCESSING) != 0) { ret = -ECHILD;