sched/sched/sched_waitpid.c: Fix return value

waitpid should return the process ID of the child whose state has changed even if pid is -1.
This commit is contained in:
Yoshinori Sugino 2020-11-29 13:27:11 +09:00 committed by Xiang Xiao
parent 68ff96c242
commit 5dabb4c2d8

View File

@ -332,6 +332,7 @@ pid_t nx_waitpid(pid_t pid, int *stat_loc, int options)
/* The child has exited. Return the saved exit status */
*stat_loc = child->ch_status << 8;
pid = child->ch_pid;
/* Discard the child entry and break out of the loop */