Skip to content

Commit

Permalink
chore: Upgrade sysinfo 0.30.13 -> 0.31.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Frederick888 committed Aug 12, 2024
1 parent dfbd43c commit 1bb5402
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 30 deletions.
32 changes: 6 additions & 26 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ serde_json = "1.0.52"
slog = "2.5.2"
slog-term = "2.5.0"
strum = { version = "0.26.1", features = ["derive"] }
sysinfo = "0.30.5"
sysinfo = "0.31.2"
tabwriter = "1.2.1"
which = "6.0.0"
yubico_manager = { version = "0.9.0", optional = true }
Expand Down
8 changes: 5 additions & 3 deletions src/utils/callers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ use anyhow::{anyhow, Result};
#[cfg(unix)]
use std::ops::Deref;
use std::path::PathBuf;
use sysinfo::{get_current_pid, ProcessRefreshKind, RefreshKind, System, UpdateKind};
use sysinfo::{
get_current_pid, ProcessRefreshKind, ProcessesToUpdate, RefreshKind, System, UpdateKind,
};

#[derive(Debug)]
pub struct CurrentCaller {
Expand All @@ -32,7 +34,7 @@ impl CurrentCaller {
.with_exe(UpdateKind::OnlyIfNotSet),
),
);
system.refresh_process(pid);
system.refresh_processes(ProcessesToUpdate::Some(&[pid]));
let proc = system
.process(pid)
.ok_or_else(|| anyhow!("Failed to retrieve information of current process"))?;
Expand All @@ -41,7 +43,7 @@ impl CurrentCaller {
.parent()
.ok_or_else(|| anyhow!("Failed to retrieve parent PID"))?;
info!("PPID: {}", ppid);
system.refresh_process(ppid);
system.refresh_processes(ProcessesToUpdate::Some(&[ppid]));
let pproc = system
.process(ppid)
.ok_or_else(|| anyhow!("Failed to retrieve information of parent process"))?;
Expand Down

0 comments on commit 1bb5402

Please sign in to comment.