diff --git a/src/pid.c b/src/pid.c index 428f26ff..780e12a0 100644 --- a/src/pid.c +++ b/src/pid.c @@ -95,18 +95,15 @@ char *pid_get_name(pid_t pid, char *name, size_t len) char *pid_file(svc_t *svc) { - static char path[256]; - char fn[MAX_ARG_LEN]; - if (svc->pidfile[0]) { if (svc->pidfile[0] == '!') return &svc->pidfile[1]; return svc->pidfile; } - snprintf(fn, sizeof(fn), "%s%s.pid", _PATH_VARRUN, basename(svc->cmd)); + errno = ENOENT; - return pid_runpath(fn, path, sizeof(path)); + return NULL; } pid_t pid_file_read(const char *fn) diff --git a/src/service.c b/src/service.c index a877a452..5ac2e6f5 100644 --- a/src/service.c +++ b/src/service.c @@ -616,7 +616,7 @@ static void service_cleanup(svc_t *svc) char *fn; fn = pid_file(svc); - if (remove(fn) && errno != ENOENT) + if (fn && remove(fn) && errno != ENOENT) logit(LOG_CRIT, "Failed removing service %s pidfile %s", basename(svc->cmd), fn);