diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/kernel/syscalls.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/kernel/syscalls.c b/src/kernel/syscalls.c index 8636a1b..35b243f 100644 --- a/src/kernel/syscalls.c +++ b/src/kernel/syscalls.c @@ -23,15 +23,13 @@ int _syscall_await(void) { bool has_children = false; process_transition(process_current, PS_WAITS4CHILDDEATH); - // find any already dead children for (struct process *iter = process_current->child; - iter; iter = iter->sibling) { - if (iter->state == PS_DEAD && !iter->noreap) { - assert(!iter->noreap); + iter; iter = iter->sibling) + { + if (iter->noreap) continue; + has_children = true; + if (iter->state == PS_DEAD) SYSCALL_RETURN(process_try2collect(iter)); - } else { - has_children = true; - } } if (!has_children) { |