higher sysinfo version

This commit is contained in:
rustdesk
2023-03-10 23:41:01 +08:00
parent 38c9e142ff
commit 09b823d637
4 changed files with 7 additions and 10 deletions

View File

@@ -547,13 +547,13 @@ async fn check_pid(postfix: &str) {
if let Ok(mut file) = File::open(&pid_file) {
let mut content = String::new();
file.read_to_string(&mut content).ok();
let pid = content.parse::<i32>().unwrap_or(0);
let pid = content.parse::<usize>().unwrap_or(0);
if pid > 0 {
use hbb_common::sysinfo::{ProcessExt, System, SystemExt};
let mut sys = System::new();
sys.refresh_processes();
if let Some(p) = sys.process(pid.into()) {
if let Some(current) = sys.process((std::process::id() as i32).into()) {
if let Some(current) = sys.process((std::process::id() as usize).into()) {
if current.name() == p.name() {
// double check with connect
if connect(1000, postfix).await.is_ok() {