From 253460b4b87c05b78a14ae0aec29a9307f56b737 Mon Sep 17 00:00:00 2001 From: Joachim Nilsson Date: Thu, 21 Jan 2016 23:28:59 +0100 Subject: [PATCH] Make pidfile() name accessible (read-only) to daemon as __pidfile_name Signed-off-by: Joachim Nilsson --- pidfile.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pidfile.c b/pidfile.c index ab10ce4..d38c5ac 100644 --- a/pidfile.c +++ b/pidfile.c @@ -43,6 +43,7 @@ static pid_t pidfile_pid; static void pidfile_cleanup(void); +const char *__pidfile_name = NULL; extern char *__progname; int @@ -58,6 +59,7 @@ pidfile(const char *basename) if (pidfile_path != NULL) { free(pidfile_path); pidfile_path = NULL; + __pidfile_name = NULL; } /* _PATH_VARRUN includes trailing / */ @@ -101,6 +103,7 @@ pidfile(const char *basename) errno = save_errno; return (-1); } + __pidfile_name = pidfile_path; return (0); }