Use pid_runpath() in svc_find_by_pidfile(), used by pidfile plugin

The pidfile plugin just listens to changes in files in /run or /var/run,
so when trying to locate an svc_t from a file change we need to compare
using the proper prefix path.

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
Joachim Nilsson committed 2018-01-13 21:47:11 +01:00
1 parent 91b550662e
commit 32d9afc7bb
3 files changed
+7 -6

No files matched your search

+3 -1
View File
@@ -355,7 +355,9 @@ svc_t *svc_find_by_pidfile(char *fn)
svc_t *svc, *iter = NULL;
for (svc = svc_iterator(&iter, 1); svc; svc = svc_iterator(&iter, 0)) {
if (string_compare(fn, pid_file(svc)))
char path[MAX_ARG_LEN];
if (string_compare(pid_runpath(fn, path, sizeof(path)), pid_file(svc)))
return svc;
}