Skip to content

Commit

Permalink
Reap zombie processes
Browse files Browse the repository at this point in the history
The init process does that by calling wait()
  • Loading branch information
AXKuhta committed Aug 2, 2023
1 parent a9cceef commit 7266c46
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion micro_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -589,7 +589,8 @@ int main() {
// But let's just make sure that we can't continue from this location
return 0;
} else {
waitpid(shell_pid, NULL, 0);
while (shell_pid != wait(NULL)) {
}

printf("Initial shell exited, entering shutdown sequence\n");

Expand Down

0 comments on commit 7266c46

Please sign in to comment.