From c14c6a1e6233d27899938c81f8a2022bf57444fb Mon Sep 17 00:00:00 2001 From: Joachim Nilsson Date: Thu, 7 Jan 2016 02:45:48 +0100 Subject: [PATCH] pidfile.c: Add LITE #ifdef pidfile and comment LITE mtime extension Signed-off-by: Joachim Nilsson --- pidfile.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pidfile.c b/pidfile.c index bde9b34..ab10ce4 100644 --- a/pidfile.c +++ b/pidfile.c @@ -37,7 +37,8 @@ #include #include -static char *pidfile_path; +#ifndef pidfile +static char *pidfile_path = NULL; static pid_t pidfile_pid; static void pidfile_cleanup(void); @@ -83,6 +84,10 @@ pidfile(const char *basename) } (void) fclose(f); + /* + * LITE extension, no need to set up another atexit() handler + * if user only called us to update the mtime of the PID file + */ if (pidfile_pid == pid) return (0); @@ -107,3 +112,4 @@ pidfile_cleanup(void) if (pidfile_path != NULL && pidfile_pid == getpid()) (void) unlink(pidfile_path); } +#endif