File pacemaker-libcommon-procfs-pid.patch of Package pacemaker.3577
commit 124e3f176cf411cfb957b681d44c47eb550c06d1
Author: Ken Gaillot <kgaillot@redhat.com>
Date: Mon May 16 17:32:35 2016 -0500
Fix: libcommon: crm_procfs_pid_of() would always return last /proc entry checked
This fixes a bug introduced in 1.1.14 via a066eaa and 4797c81 when getting the
PID of a process name. The bug only triggered if the process wasn't running, so
the main effect was to mistakenly set have-watchdog to true even though sbd was
not running.
diff --git a/lib/common/procfs.c b/lib/common/procfs.c
index 499adb7..2d25efb 100644
--- a/lib/common/procfs.c
+++ b/lib/common/procfs.c
@@ -135,6 +135,7 @@ crm_procfs_pid_of(const char *name)
crm_info("Found %s active as process %d", name, pid);
break;
}
+ pid = 0;
}
closedir(dp);
return pid;