summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2024-11-23 15:08:52 -0500
committerTavian Barnes <tavianator@tavianator.com>2024-11-23 15:08:52 -0500
commitf7b813fdffb6c744cd443c6d5f81e6918b20f1ac (patch)
tree2d6c9b7429948e4c6d71bcde060f9ce26bfb2385
parent3efb24019f73cca1c355063f7abe0b7641a67dfc (diff)
downloadbfs-f7b813fdffb6c744cd443c6d5f81e6918b20f1ac.tar.xz
sighook: Check for SA_RESTART before using it
QNX doesn't support SA_RESTART.
-rw-r--r--src/sighook.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/sighook.c b/src/sighook.c
index 0cc81fa..cd17e42 100644
--- a/src/sighook.c
+++ b/src/sighook.c
@@ -460,9 +460,15 @@ static void sigdispatch(int sig, siginfo_t *info, void *context) {
/** Make sure our signal handler is installed for a given signal. */
static int siginit(int sig) {
+#ifdef SA_RESTART
+# define BFS_SA_RESTART SA_RESTART
+#else
+# define BFS_SA_RESTART 0
+#endif
+
static struct sigaction action = {
.sa_sigaction = sigdispatch,
- .sa_flags = SA_RESTART | SA_SIGINFO,
+ .sa_flags = BFS_SA_RESTART | SA_SIGINFO,
};
static sigset_t signals;