From 292e55a3c344e649d271cfb3c9063ac8b2484de6 Mon Sep 17 00:00:00 2001 From: dzwdz Date: Fri, 6 May 2022 13:31:11 +0200 Subject: kernel/proc: get rid of the PS_DEADER state, free processes asap --- src/kernel/syscalls.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/kernel/syscalls.c') diff --git a/src/kernel/syscalls.c b/src/kernel/syscalls.c index 01d42a0..f3161e5 100644 --- a/src/kernel/syscalls.c +++ b/src/kernel/syscalls.c @@ -23,10 +23,12 @@ int _syscall_await(void) { // find any already dead children for (struct process *iter = process_current->child; iter; iter = iter->sibling) { - if (iter->state == PS_DEAD && !iter->noreap) + if (iter->state == PS_DEAD && !iter->noreap) { + assert(!iter->noreap); SYSCALL_RETURN(process_try2collect(iter)); - if (iter->state != PS_DEADER) + } else { has_children = true; + } } if (!has_children) { -- cgit v1.2.3