Skip to content

Commit 09f0d4c

Browse files
committed
Some correction for non-linux platforms
Signed-off-by: Malhar Vora <mlvora.2010@gmail.com>
1 parent 3be01aa commit 09f0d4c

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

src/uu/kill/src/errors.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ use uucore::error::UError;
99

1010
#[derive(Debug)]
1111
pub enum KillError {
12-
/// Unsupported platform
1312
#[cfg(not(target_os = "linux"))]
1413
UnsupportedPlatform,
1514
OperationNotPermitted(i32),

src/uu/kill/src/kill.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@
88

99
mod errors;
1010

11-
use crate::errors::KillError::{self, NoSuchProcess, OperationNotPermitted};
11+
use crate::errors::KillError;
12+
#[cfg(target_os = "linux")]
13+
use crate::errors::KillError::{NoSuchProcess, OperationNotPermitted};
1214
use clap::{Arg, ArgAction, Command, crate_version, value_parser};
1315
use uucore::libc;
1416
use uucore::{error::UResult, format_usage, help_about, help_usage};
@@ -18,7 +20,7 @@ const USAGE: &str = help_usage!("kill.md");
1820

1921
#[cfg(not(target_os = "linux"))]
2022
fn kill(pid: i32, signal: i32) -> Result<(), KillError> {
21-
Err(UnsupportedPlatform)
23+
Err(KillError::UnsupportedPlatform)
2224
}
2325

2426
#[cfg(target_os = "linux")]

0 commit comments

Comments
 (0)