File bsc#1131353-bsc#1131356-0009-Low-libcrmcommon-return-proper-code-if-testing-pid-i-1.1.patch of Package pacemaker.14737

From c0e1cf579f57922cbe872d23edf144dd2206156b Mon Sep 17 00:00:00 2001
From: Ken Gaillot <kgaillot@redhat.com>
Date: Mon, 29 Apr 2019 14:34:32 -0500
Subject: [PATCH 9/9] Low: libcrmcommon: return proper code if testing pid is
 denied

d0c12d9 avoided a use-of-NULL in an unlikely corner case, but returned the
wrong code in that case.
---
 lib/common/utils.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/common/utils.c b/lib/common/utils.c
index 87f8d8e82..f9a2c1a61 100644
--- a/lib/common/utils.c
+++ b/lib/common/utils.c
@@ -733,7 +733,7 @@ crm_pid_active(long pid, const char *daemon)
     } else if ((rc = kill(pid, 0)) < 0 && errno == ESRCH) {
         return 0;  /* no such PID detected */
 
-    } else if (rc < 0 && have_proc_pid == -1) {
+    } else if (rc < 0 && (daemon == NULL || have_proc_pid == -1)) {
         if (last_asked_pid != pid) {
             crm_info("Cannot examine PID %ld: %s", pid, strerror(errno));
             last_asked_pid = pid;
-- 
2.16.4

openSUSE Build Service is sponsored by