pidfile.c: Add LITE #ifdef pidfile and comment LITE mtime extension

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
Joachim Nilsson committed 2016-01-07 02:58:06 +01:00
1 parent 8aecba2b7a
commit c14c6a1e62
1 file changed
+7 -1
+7 -1
View File
@@ -37,7 +37,8 @@
#include <stdlib.h>
#include <unistd.h>
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