summaryrefslogtreecommitdiff
path: root/src/kernel/proc.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/kernel/proc.c')
-rw-r--r--src/kernel/proc.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/kernel/proc.c b/src/kernel/proc.c
index 54efe85..3233725 100644
--- a/src/kernel/proc.c
+++ b/src/kernel/proc.c
@@ -113,9 +113,6 @@ _Noreturn void process_switch_any(void) {
struct process *found = process_find(PS_RUNNING);
if (found) process_switch(found);
- if (process_first->state == PS_DEAD)
- shutdown(); // TODO not the place for this
-
cpu_pause();
process_switch_any();
}
@@ -253,6 +250,8 @@ void process_kill(struct process *p, int ret) {
assert(!p->child);
process_try2collect(p);
+
+ if (p == process_first) shutdown();
}
int process_try2collect(struct process *dead) {