mirror of
https://github.com/rustdesk/rustdesk.git
synced 2024-12-11 17:59:15 +08:00
fix macos and linux vm reboot
Signed-off-by: 21pages <pages21@163.com>
This commit is contained in:
parent
13005e8242
commit
e17378c6b3
@ -2130,14 +2130,20 @@ impl Connection {
|
||||
return false;
|
||||
}
|
||||
|
||||
Some(misc::Union::RestartRemoteDevice(_)) =>
|
||||
{
|
||||
Some(misc::Union::RestartRemoteDevice(_)) => {
|
||||
#[cfg(not(any(target_os = "android", target_os = "ios")))]
|
||||
if self.restart {
|
||||
// force_reboot, not work on linux vm and macos 14
|
||||
#[cfg(any(target_os = "linux", target_os = "windows"))]
|
||||
match system_shutdown::force_reboot() {
|
||||
Ok(_) => log::info!("Restart by the peer"),
|
||||
Err(e) => log::error!("Failed to restart: {}", e),
|
||||
}
|
||||
#[cfg(any(target_os = "linux", target_os = "macos"))]
|
||||
match system_shutdown::reboot() {
|
||||
Ok(_) => log::info!("Restart by the peer"),
|
||||
Err(e) => log::error!("Failed to restart: {}", e),
|
||||
}
|
||||
}
|
||||
}
|
||||
#[cfg(windows)]
|
||||
|
Loading…
Reference in New Issue
Block a user