fix: windows incompatible cmd options for w10 and newer

prevent lowering xmrig priority on windows 10&11
This commit is contained in:
Cyrix126 2024-07-18 14:14:23 +02:00
parent 0865fe2ef2
commit f1229ef914

View file

@ -471,8 +471,11 @@ impl Helper {
info!("XMRig | Entering watchdog mode... woof!"); info!("XMRig | Entering watchdog mode... woof!");
// needs xmrig to be in belownormal priority or else Gupaxx will be in trouble if it does not have enough cpu time. // needs xmrig to be in belownormal priority or else Gupaxx will be in trouble if it does not have enough cpu time.
#[cfg(target_os = "windows")] #[cfg(target_os = "windows")]
{
use std::os::windows::process::CommandExt;
std::process::Command::new("cmd") std::process::Command::new("cmd")
.args(["/c", "/q", "wmic"]) .creation_flags(0x08000000)
.args(["/c", "wmic"])
.args([ .args([
"process", "process",
"where", "where",
@ -483,6 +486,7 @@ impl Helper {
]) ])
.spawn() .spawn()
.expect("failure to execute command wmic"); .expect("failure to execute command wmic");
}
loop { loop {
// Set timer // Set timer
let now = Instant::now(); let now = Instant::now();