Skip to content

Commit

Permalink
Merge pull request #1442 from asomers/issue-1441
Browse files Browse the repository at this point in the history
Suppress a build warning on Fuchsia
  • Loading branch information
asomers authored May 30, 2021
2 parents df9ed93 + cd6525f commit 9f1b35b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/sys/signal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -850,10 +850,10 @@ mod sigevent {
/// Linux, Solaris, and portable programs should prefer `SIGEV_THREAD_ID` or
/// `SIGEV_SIGNAL`. That field is part of a union that shares space with the
/// more genuinely useful `sigev_notify_thread_id`
// Allow invalid_value warning on Fuchsia only.
// See https://github.com/nix-rust/nix/issues/1441
#[cfg_attr(target_os = "fuchsia", allow(invalid_value))]
pub fn new(sigev_notify: SigevNotify) -> SigEvent {
// NB: This uses MaybeUninit rather than mem::zeroed because libc::sigevent contains a
// function pointer on Fuchsia as of https://github.com/rust-lang/libc/commit/2f59370,
// and function pointers must not be null.
let mut sev = unsafe { mem::MaybeUninit::<libc::sigevent>::zeroed().assume_init() };
sev.sigev_notify = match sigev_notify {
SigevNotify::SigevNone => libc::SIGEV_NONE,
Expand Down

0 comments on commit 9f1b35b

Please sign in to comment.