Skip to content

Commit 14d402c

Browse files
committed
fix: Ctrl+C should not kill the init process
1 parent 9be52f9 commit 14d402c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

kernel/src/processes/process_table.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,11 @@ impl ProcessTable {
3434
pub fn get_highest_pid_without(&self, process_names: &[&str]) -> Option<Pid> {
3535
self.processes
3636
.iter()
37+
.max_by_key(|(pid, _)| *pid)
3738
.filter(|(_, p)| {
3839
let p = p.lock();
3940
!process_names.iter().any(|n| p.get_name() == *n) && p.get_pid() != NEVER_PID
4041
})
41-
.max_by_key(|(pid, _)| *pid)
4242
.map(|(pid, _)| *pid)
4343
}
4444

0 commit comments

Comments
 (0)