Skip to content

Commit

Permalink
only include the sa_restorer field when not on mac
Browse files Browse the repository at this point in the history
the struct doesn't have this field on mac:
https://docs.rs/libc/latest/x86_64-apple-darwin/libc/struct.sigaction.html

fortunately, we just set it to None here anyway, even on linux
  • Loading branch information
ntBre committed Aug 27, 2024
1 parent 6927a04 commit 4dcb85e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/key_handlers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -534,6 +534,7 @@ pub(crate) unsafe extern "C" fn spawn(arg: *const Arg) {
// MaybeUninit the whole sigaction if I can avoid it
sa_mask: std::mem::zeroed(),
sa_flags: 0,
#[cfg(not(target_os = "macos"))]
sa_restorer: None,
};
libc::sigemptyset(&mut sa.sa_mask);
Expand Down
1 change: 1 addition & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@ fn setup() {
sa_flags: libc::SA_NOCLDSTOP
| libc::SA_NOCLDWAIT
| libc::SA_RESTART,
#[cfg(not(target_os = "macos"))]
sa_restorer: None,
};
libc::sigemptyset(&mut sa.sa_mask);
Expand Down

0 comments on commit 4dcb85e

Please sign in to comment.