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:
parent
68ff96c242
commit
5dabb4c2d8
@ -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 */
|
/* The child has exited. Return the saved exit status */
|
||||||
|
|
||||||
*stat_loc = child->ch_status << 8;
|
*stat_loc = child->ch_status << 8;
|
||||||
|
pid = child->ch_pid;
|
||||||
|
|
||||||
/* Discard the child entry and break out of the loop */
|
/* Discard the child entry and break out of the loop */
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user