Make pidfile() name accessible (read-only) to daemon as __pidfile_name

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
Joachim Nilsson committed 2016-01-21 23:28:59 +01:00
1 parent acc59e0c1f
commit 253460b4b8
1 file changed
+3
+3
View File
@@ -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);
}