summaryrefslogtreecommitdiff
path: root/run-command.c
diff options
context:
space:
mode:
Diffstat (limited to 'run-command.c')
-rw-r--r--run-command.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/run-command.c b/run-command.c
index 402138b8b5..8833b23367 100644
--- a/run-command.c
+++ b/run-command.c
@@ -515,7 +515,13 @@ static void atfork_prepare(struct atfork_state *as)
{
sigset_t all;
- if (sigfillset(&all))
+ /*
+ * POSIX says sigfillset() can fail, but an overly clever
+ * compiler can see through the header files and decide
+ * it cannot fail on a particular platform it is compiling for,
+ * triggering -Wunreachable-code false positive.
+ */
+ if (NOT_CONSTANT(sigfillset(&all)))
die_errno("sigfillset");
#ifdef NO_PTHREADS
if (sigprocmask(SIG_SETMASK, &all, &as->old))