mirror of
https://github.com/weyne85/rustdesk.git
synced 2025-10-29 17:00:05 +00:00
fix: Fix sysinfo >=0.29.1 crashing the main view on macOS
This commit is contained in:
@@ -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();
|
||||
|
||||
@@ -596,7 +596,7 @@ async fn check_pid(postfix: &str) {
|
||||
file.read_to_string(&mut content).ok();
|
||||
let pid = content.parse::<usize>().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()) {
|
||||
|
||||
Reference in New Issue
Block a user