From f7b813fdffb6c744cd443c6d5f81e6918b20f1ac Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Sat, 23 Nov 2024 15:08:52 -0500 Subject: sighook: Check for SA_RESTART before using it QNX doesn't support SA_RESTART. --- src/sighook.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src') 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; -- cgit v1.2.3