Skip to content

Commit

Permalink
feature fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrysoliteAzalea committed Jun 16, 2024
1 parent 32762c1 commit 760fb61
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/sys/signal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -510,12 +510,20 @@ impl From<Signal> for SignalValue {
impl TryFrom<SignalValue> for Signal {
type Error = Errno;

#[cfg(target_os = "linux")]
fn try_from(x: SignalValue) -> Result<Self> {
match x {
SignalValue::Standard(s) => Ok(s),
SignalValue::Realtime(_) => Err(Errno::EINVAL),
}
}

#[cfg(not(target_os = "linux"))]
fn try_from(x: SignalValue) -> Result<Self> {
match x {
SignalValue::Standard(s) => Ok(s),
}
}
}

feature! {
Expand Down

0 comments on commit 760fb61

Please sign in to comment.