diff --git a/Cargo.lock b/Cargo.lock index 9a79c58e7..496767787 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3371,9 +3371,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.149" +version = "0.2.150" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a08173bc88b7955d1b3145aa561539096c421ac8debde8cbc3612ec635fee29b" +checksum = "89d92a4743f9a61002fae18374ed11e7973f530cb3a3255fb354818118b2203c" [[package]] name = "libdbus-sys" @@ -5887,8 +5887,7 @@ dependencies = [ [[package]] name = "sysinfo" version = "0.29.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a18d114d420ada3a891e6bc8e96a2023402203296a47cdd65083377dad18ba5" +source = "git+https://github.com/GuillaumeGomez/sysinfo#f45dcc6510d48c3a1401c5a33eedccc8899f67b2" dependencies = [ "cfg-if 1.0.0", "core-foundation-sys 0.8.4", @@ -5896,7 +5895,7 @@ dependencies = [ "ntapi", "once_cell", "rayon", - "winapi 0.3.9", + "windows 0.51.1", ] [[package]] diff --git a/libs/hbb_common/Cargo.toml b/libs/hbb_common/Cargo.toml index eb5dde257..773116409 100644 --- a/libs/hbb_common/Cargo.toml +++ b/libs/hbb_common/Cargo.toml @@ -38,7 +38,8 @@ libc = "0.2" dlopen = "0.1" toml = "0.7" uuid = { version = "1.3", features = ["v4"] } -sysinfo = "0.29" +# crash, versions >= 0.29.1 are affected by #GuillaumeGomez/sysinfo/1052 +sysinfo = { git = "https://github.com/rustdesk-org/sysinfo" } [target.'cfg(not(any(target_os = "android", target_os = "ios")))'.dependencies] mac_address = "1.1" diff --git a/libs/scrap/src/common/codec.rs b/libs/scrap/src/common/codec.rs index c2149288e..b934c7f82 100644 --- a/libs/scrap/src/common/codec.rs +++ b/libs/scrap/src/common/codec.rs @@ -26,7 +26,7 @@ use hbb_common::{ supported_decoding::PreferCodec, video_frame, Chroma, CodecAbility, EncodedVideoFrames, SupportedDecoding, SupportedEncoding, VideoFrame, }, - sysinfo::{System, SystemExt}, + sysinfo::{System}, tokio::time::Instant, ResultType, }; diff --git a/src/common.rs b/src/common.rs index 0957718e4..1667ea66a 100644 --- a/src/common.rs +++ b/src/common.rs @@ -877,7 +877,7 @@ pub fn hostname() -> String { #[inline] pub fn get_sysinfo() -> serde_json::Value { - use hbb_common::sysinfo::{CpuExt, System, SystemExt}; + use hbb_common::sysinfo::{System}; let system = System::new_all(); let memory = system.total_memory(); let memory = (memory as f64 / 1024. / 1024. / 1024. * 100.).round() / 100.; @@ -1213,7 +1213,7 @@ pub async fn get_next_nonkeyexchange_msg( #[cfg(not(any(target_os = "android", target_os = "ios")))] pub fn check_process(arg: &str, same_uid: bool) -> bool { - use hbb_common::sysinfo::{ProcessExt, System, SystemExt}; + use hbb_common::sysinfo::{System}; let mut sys = System::new(); sys.refresh_processes(); let mut path = std::env::current_exe().unwrap_or_default(); diff --git a/src/ipc.rs b/src/ipc.rs index aea90a498..c19ac3921 100644 --- a/src/ipc.rs +++ b/src/ipc.rs @@ -596,7 +596,7 @@ async fn check_pid(postfix: &str) { file.read_to_string(&mut content).ok(); let pid = content.parse::().unwrap_or(0); if pid > 0 { - use hbb_common::sysinfo::{ProcessExt, System, SystemExt}; + use hbb_common::sysinfo::{System}; let mut sys = System::new(); sys.refresh_processes(); if let Some(p) = sys.process(pid.into()) {