Skip to content

Commit

Permalink
remove linux kill process
Browse files Browse the repository at this point in the history
  • Loading branch information
mmrrnn committed Aug 9, 2024
1 parent 4be2ea4 commit ba3f99a
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions src-tauri/src/process_killer.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,4 @@
use std::process::Command;

pub fn kill_process(pid: u32) -> Result<(), anyhow::Error> {
#[cfg(target_os = "linux")]
{
let _ = Command::new("kill")
.args(&["-9", &pid.to_string()])
.output()?;
}

#[cfg(target_os = "windows")]
{
let _ = Command::new("taskkill")
Expand All @@ -21,7 +12,7 @@ pub fn kill_process(pid: u32) -> Result<(), anyhow::Error> {
use nix::unistd::Pid;

let pid = Pid::from_raw(pid as i32);
signal::kill(pid, Signal::SIGTERM);
let _ = signal::kill(pid, Signal::SIGTERM);
}
Ok(())
}

0 comments on commit ba3f99a

Please sign in to comment.