Skip to content

Commit

Permalink
Don't use non linux enums on linux
Browse files Browse the repository at this point in the history
  • Loading branch information
danielsn committed Feb 6, 2025
1 parent e9867ad commit 8050f45
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions crashtracker/src/crash_info/sig_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,24 @@ impl From<nix::sys::signal::Signal> for SignalNames {
nix::sys::signal::Signal::SIGWINCH => SignalNames::SIGWINCH,
nix::sys::signal::Signal::SIGIO => SignalNames::SIGIO,
nix::sys::signal::Signal::SIGSYS => SignalNames::SIGSYS,
#[cfg(not(any(
target_os = "android",
target_os = "emscripten",
target_os = "fuchsia",
target_os = "linux",
target_os = "redox",
target_os = "haiku"
)))]
nix::sys::signal::Signal::SIGEMT => SignalNames::SIGEMT,
#[cfg(not(any(
target_os = "android",
target_os = "emscripten",
target_os = "fuchsia",
target_os = "linux",
target_os = "redox",
target_os = "haiku",
target_os = "aix"
)))]
nix::sys::signal::Signal::SIGINFO => SignalNames::SIGINFO,
_ => SignalNames::UNKNOWN,
}
Expand Down Expand Up @@ -165,7 +182,24 @@ pub fn signal_from_signum(value: libc::c_int) -> anyhow::Result<nix::sys::signal
libc::SIGWINCH => nix::sys::signal::Signal::SIGWINCH,
libc::SIGIO => nix::sys::signal::Signal::SIGIO,
libc::SIGSYS => nix::sys::signal::Signal::SIGSYS,
#[cfg(not(any(
target_os = "android",
target_os = "emscripten",
target_os = "fuchsia",
target_os = "linux",
target_os = "redox",
target_os = "haiku"
)))]
libc::SIGEMT => nix::sys::signal::Signal::SIGEMT,
#[cfg(not(any(
target_os = "android",
target_os = "emscripten",
target_os = "fuchsia",
target_os = "linux",
target_os = "redox",
target_os = "haiku",
target_os = "aix"
)))]
libc::SIGINFO => nix::sys::signal::Signal::SIGINFO,
_ => anyhow::bail!("Unexpected signal number {value}"),
};
Expand Down

0 comments on commit 8050f45

Please sign in to comment.