From 4dcb85e5c9d08dc8cc0105f3cbbfa58fbe06bef8 Mon Sep 17 00:00:00 2001 From: Brent Westbrook Date: Tue, 27 Aug 2024 15:32:55 -0400 Subject: [PATCH] only include the sa_restorer field when not on mac 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 --- src/key_handlers.rs | 1 + src/main.rs | 1 + 2 files changed, 2 insertions(+) diff --git a/src/key_handlers.rs b/src/key_handlers.rs index 49e9abe..8647368 100644 --- a/src/key_handlers.rs +++ b/src/key_handlers.rs @@ -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); diff --git a/src/main.rs b/src/main.rs index 9d9902b..2b71fee 100644 --- a/src/main.rs +++ b/src/main.rs @@ -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);