dd works on macOS now.

This commit is contained in:
ClementTsang 2020-01-30 23:13:12 -05:00
parent eea1d29da8
commit 24f0bbc852

View File

@ -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: