From 9618253c62129ce08fabd8338e1fc6668c641bf8 Mon Sep 17 00:00:00 2001 From: Ken Gaillot Date: Tue, 22 Oct 2019 10:23:06 -0500 Subject: [PATCH] Refactor: libcrmservice: make static analysis happy --- lib/services/services_linux.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/services/services_linux.c b/lib/services/services_linux.c index 65a6a7b8cbb..42ca2ae90a4 100644 --- a/lib/services/services_linux.c +++ b/lib/services/services_linux.c @@ -536,9 +536,12 @@ action_synced_wait(svc_action_t * op, sigset_t *mask) int wait_rc = 0; #ifdef HAVE_SYS_SIGNALFD_H - sfd = signalfd(-1, mask, SFD_NONBLOCK); - if (sfd < 0) { - crm_perror(LOG_ERR, "signalfd() failed"); + // mask is always non-NULL in practice, but this makes static analysis happy + if (mask) { + sfd = signalfd(-1, mask, SFD_NONBLOCK); + if (sfd < 0) { + crm_perror(LOG_ERR, "signalfd() failed"); + } } #else sfd = sigchld_pipe[0];