ched/sched/sched_waitpid.c: In waitpid, remember to grab the exited child ptr. After being unblocked in waitpid, the child pointer might be NULL. Modify to use group_exitchild to get the pointer of recent exited child.

This commit is contained in:
Yang ChungFan 2019-07-20 07:20:21 -06:00 committed by Gregory Nutt
parent 19f9e0038e
commit 8181a92a1d
1 changed files with 1 additions and 0 deletions

View File

@ -542,6 +542,7 @@ pid_t waitpid(pid_t pid, int *stat_loc, int options)
#ifdef CONFIG_SCHED_CHILD_STATUS
if (retains)
{
child = group_exitchild(rtcb->group);
DEBUGASSERT(child != NULL);
/* Discard the child entry */