Skip to content

Commit

Permalink
fix: clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
oneofthezombies committed Feb 6, 2024
1 parent 51ec382 commit e2d0ac4
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion crates/libs/kill_tree/src/macos.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,17 @@ pub(crate) async fn get_process_info(process_id: ProcessId) -> Option<ProcessInf
}
};
let mut proc_bsdinfo = unsafe { std::mem::zeroed::<libproc::proc_bsdinfo>() };
let proc_pidtbsdinfo_sign = match i32::try_from(libproc::PROC_PIDTBSDINFO) {
Ok(x) => x,
Err(e) => {
debug!(error = ?e, "failed to convert PROC_PIDTBSDINFO");
return None;
}
};
let result = unsafe {
libproc::proc_pidinfo(
process_id as i32,
libproc::PROC_PIDTBSDINFO as i32,
proc_pidtbsdinfo_sign,
0,
std::ptr::addr_of_mut!(proc_bsdinfo).cast::<c_void>(),
proc_bsdinfo_size_sign,
Expand Down

0 comments on commit e2d0ac4

Please sign in to comment.