Skip to content

Commit

Permalink
fix: Ctrl+C should not kill the init process
Browse files Browse the repository at this point in the history
  • Loading branch information
sysheap committed Dec 15, 2024
1 parent 9be52f9 commit 14d402c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion kernel/src/processes/process_table.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@ impl ProcessTable {
pub fn get_highest_pid_without(&self, process_names: &[&str]) -> Option<Pid> {
self.processes
.iter()
.max_by_key(|(pid, _)| *pid)
.filter(|(_, p)| {
let p = p.lock();
!process_names.iter().any(|n| p.get_name() == *n) && p.get_pid() != NEVER_PID
})
.max_by_key(|(pid, _)| *pid)
.map(|(pid, _)| *pid)
}

Expand Down

0 comments on commit 14d402c

Please sign in to comment.