diff options
Diffstat (limited to 'kernel/cpu/syscall.c')
-rw-r--r-- | kernel/cpu/syscall.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/kernel/cpu/syscall.c b/kernel/cpu/syscall.c index a78e63e..31f1fc5 100644 --- a/kernel/cpu/syscall.c +++ b/kernel/cpu/syscall.c @@ -427,6 +427,8 @@ void syscall_wait(int *status) { if (status) { *status = current_task->child_rc; } + process_remove_reference(current_task->child); + current_task->child = NULL; return; } do { @@ -444,6 +446,10 @@ void syscall_wait(int *status) { if (status) { *status = current_task->child_rc; } + if (current_task->child->dead) { + process_remove_reference(current_task->child); + current_task->child = NULL; + } } int syscall_fork(void) { |