From 12ce1683a5901ffa00b96f5805855e568a3c6054 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Thu, 31 Dec 2015 01:20:14 +0100 Subject: daemonise: add option to override pid file MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- include/unistd.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'include/unistd.h') diff --git a/include/unistd.h b/include/unistd.h index d95e08a..8479ae9 100644 --- a/include/unistd.h +++ b/include/unistd.h @@ -1081,6 +1081,14 @@ int daemon(int, int) */ #define DAEMONISE_KEEP_FDS 1024 +/** + * Override the PID file if it already exists, + * rather than failing. It is a bad idea to do + * this unless you already made sure that the + * daemon is not already running. + */ +#define DAEMONISE_NEW_PID 2048 + /** * Daemonise the process. This means to: * @@ -1163,6 +1171,7 @@ int daemon(int, int) * - `DAEMONISE_KEEP_STDIN` * - `DAEMONISE_KEEP_STDOUT` * - `DAEMONISE_KEEP_FDS` + * - `DAEMONISE_NEW_PID` * @param ... Enabled if `DAEMONISE_KEEP_FDS` is used, * do not add anything if `DAEMONISE_KEEP_FDS` * is unused. This is a `-1`-terminated list -- cgit v1.2.3-70-g09d2