Skip to content

Commit 8050f45

Browse files
committed
Don't use non linux enums on linux
1 parent e9867ad commit 8050f45

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

crashtracker/src/crash_info/sig_info.rs

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,24 @@ impl From<nix::sys::signal::Signal> for SignalNames {
125125
nix::sys::signal::Signal::SIGWINCH => SignalNames::SIGWINCH,
126126
nix::sys::signal::Signal::SIGIO => SignalNames::SIGIO,
127127
nix::sys::signal::Signal::SIGSYS => SignalNames::SIGSYS,
128+
#[cfg(not(any(
129+
target_os = "android",
130+
target_os = "emscripten",
131+
target_os = "fuchsia",
132+
target_os = "linux",
133+
target_os = "redox",
134+
target_os = "haiku"
135+
)))]
128136
nix::sys::signal::Signal::SIGEMT => SignalNames::SIGEMT,
137+
#[cfg(not(any(
138+
target_os = "android",
139+
target_os = "emscripten",
140+
target_os = "fuchsia",
141+
target_os = "linux",
142+
target_os = "redox",
143+
target_os = "haiku",
144+
target_os = "aix"
145+
)))]
129146
nix::sys::signal::Signal::SIGINFO => SignalNames::SIGINFO,
130147
_ => SignalNames::UNKNOWN,
131148
}
@@ -165,7 +182,24 @@ pub fn signal_from_signum(value: libc::c_int) -> anyhow::Result<nix::sys::signal
165182
libc::SIGWINCH => nix::sys::signal::Signal::SIGWINCH,
166183
libc::SIGIO => nix::sys::signal::Signal::SIGIO,
167184
libc::SIGSYS => nix::sys::signal::Signal::SIGSYS,
185+
#[cfg(not(any(
186+
target_os = "android",
187+
target_os = "emscripten",
188+
target_os = "fuchsia",
189+
target_os = "linux",
190+
target_os = "redox",
191+
target_os = "haiku"
192+
)))]
168193
libc::SIGEMT => nix::sys::signal::Signal::SIGEMT,
194+
#[cfg(not(any(
195+
target_os = "android",
196+
target_os = "emscripten",
197+
target_os = "fuchsia",
198+
target_os = "linux",
199+
target_os = "redox",
200+
target_os = "haiku",
201+
target_os = "aix"
202+
)))]
169203
libc::SIGINFO => nix::sys::signal::Signal::SIGINFO,
170204
_ => anyhow::bail!("Unexpected signal number {value}"),
171205
};

0 commit comments

Comments
 (0)