From ceb79ea27a202186e83b23e1fbb9ffd542253906 Mon Sep 17 00:00:00 2001 From: Ruihan Li Date: Mon, 7 Apr 2025 12:14:57 +0800 Subject: [PATCH] Always move zombie children to init --- kernel/src/process/exit.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/kernel/src/process/exit.rs b/kernel/src/process/exit.rs index 0f6deee49..1b327bfc8 100644 --- a/kernel/src/process/exit.rs +++ b/kernel/src/process/exit.rs @@ -82,8 +82,10 @@ fn move_process_children( ) -> core::result::Result<(), ()> { // Take the lock first to avoid the race when the `reaper_process` is exiting concurrently. let mut reaper_process_children = reaper_process.children().lock(); + + let is_init = is_init_process(&reaper_process); let is_zombie = reaper_process.status().is_zombie(); - if is_zombie { + if !is_init && is_zombie { return Err(()); }