This commit is contained in:
Manoj Ampalam 2017-01-25 20:54:21 -08:00 committed by GitHub
parent c6b57c018c
commit fb51120093
1 changed files with 3 additions and 0 deletions

View File

@ -208,6 +208,9 @@ int waitpid(int pid, int *status, int options) {
if (children.num_zombies) {
/* return one of them */
ret_id = children.process_id[children.num_children - 1];
GetExitCodeProcess(children.handles[children.num_children - 1], &exit_code);
if (status)
*status = exit_code;
sw_remove_child_at_index(children.num_children - 1);
return ret_id;
}