mirror of
https://github.com/ClementTsang/bottom.git
synced 2025-07-25 14:44:39 +02:00
dd works on macOS now.
This commit is contained in:
parent
eea1d29da8
commit
24f0bbc852
@ -33,7 +33,7 @@ impl Process {
|
|||||||
|
|
||||||
/// Kills a process, given a PID.
|
/// Kills a process, given a PID.
|
||||||
pub fn kill_process_given_pid(pid: u32) -> crate::utils::error::Result<()> {
|
pub fn kill_process_given_pid(pid: u32) -> crate::utils::error::Result<()> {
|
||||||
if cfg!(target_os = "linux") {
|
if cfg!(target_os = "linux") || cfg!(target_os = "macos") {
|
||||||
Command::new("kill").arg(pid.to_string()).output()?;
|
Command::new("kill").arg(pid.to_string()).output()?;
|
||||||
} else if cfg!(target_os = "windows") {
|
} else if cfg!(target_os = "windows") {
|
||||||
#[cfg(target_os = "windows")]
|
#[cfg(target_os = "windows")]
|
||||||
@ -41,11 +41,6 @@ pub fn kill_process_given_pid(pid: u32) -> crate::utils::error::Result<()> {
|
|||||||
let process = Process::open(pid as DWORD)?;
|
let process = Process::open(pid as DWORD)?;
|
||||||
process.kill()?;
|
process.kill()?;
|
||||||
}
|
}
|
||||||
} else if cfg!(target_os = "macos") {
|
|
||||||
// TODO: macOS
|
|
||||||
return Err(BottomError::GenericError {
|
|
||||||
message: "Sorry, macOS support is not implemented yet!".to_string(),
|
|
||||||
});
|
|
||||||
} else {
|
} else {
|
||||||
return Err(BottomError::GenericError {
|
return Err(BottomError::GenericError {
|
||||||
message:
|
message:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user