mirror of
https://github.com/weyne85/rustdesk.git
synced 2025-10-29 17:00:05 +00:00
remove psutil which is too old
This commit is contained in:
@@ -30,6 +30,7 @@ filetime = "0.2"
|
||||
sodiumoxide = "0.2"
|
||||
regex = "1.4"
|
||||
tokio-socks = { git = "https://github.com/fufesou/tokio-socks" }
|
||||
sysinfo = "0.22"
|
||||
|
||||
[target.'cfg(not(any(target_os = "android", target_os = "ios")))'.dependencies]
|
||||
mac_address = "1.1"
|
||||
|
||||
@@ -27,12 +27,13 @@ pub use anyhow::{self, bail};
|
||||
pub use futures_util;
|
||||
pub mod config;
|
||||
pub mod fs;
|
||||
pub use mac_address;
|
||||
pub use regex;
|
||||
pub use sodiumoxide;
|
||||
pub use sysinfo;
|
||||
pub use tokio_socks;
|
||||
pub use tokio_socks::IntoTargetAddr;
|
||||
pub use tokio_socks::TargetAddr;
|
||||
pub use mac_address;
|
||||
|
||||
#[cfg(feature = "quic")]
|
||||
pub type Stream = quic::Connection;
|
||||
@@ -185,6 +186,17 @@ pub fn get_version_number(v: &str) -> i64 {
|
||||
n
|
||||
}
|
||||
|
||||
pub fn get_process(pid: i32) -> Option<sysinfo::Process> {
|
||||
use sysinfo::{System, SystemExt};
|
||||
let mut sys = System::new();
|
||||
sys.refresh_processes();
|
||||
sys.process(pid).cloned()
|
||||
}
|
||||
|
||||
pub fn get_current_process() -> Option<sysinfo::Process> {
|
||||
get_process(std::process::id() as _)
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
||||
Reference in New Issue
Block a user