Always move zombie children to init

This commit is contained in:
Ruihan Li
2025-04-07 12:14:57 +08:00
committed by Jianfeng Jiang
parent 5ed5647d42
commit ceb79ea27a

View File

@ -82,8 +82,10 @@ fn move_process_children(
) -> core::result::Result<(), ()> { ) -> core::result::Result<(), ()> {
// Take the lock first to avoid the race when the `reaper_process` is exiting concurrently. // 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 mut reaper_process_children = reaper_process.children().lock();
let is_init = is_init_process(&reaper_process);
let is_zombie = reaper_process.status().is_zombie(); let is_zombie = reaper_process.status().is_zombie();
if is_zombie { if !is_init && is_zombie {
return Err(()); return Err(());
} }