From fd9164cd5aa087e1acc671aad36d66b4ba267c34 Mon Sep 17 00:00:00 2001 From: Gurucharan Shetty Date: Fri, 18 Apr 2014 11:04:14 -0700 Subject: [PATCH] daemon-windows: Recognize --no-chdir option for windows. The option won't have any effect on the running of the daemon. Recognizing the option lets us avoid if else conditions in unit tests. Signed-off-by: Gurucharan Shetty Acked-by: Ben Pfaff --- lib/daemon.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/daemon.h b/lib/daemon.h index 0384b6400..a5f99d58f 100644 --- a/lib/daemon.h +++ b/lib/daemon.h @@ -80,6 +80,7 @@ pid_t read_pidfile(const char *name); #else #define DAEMON_OPTION_ENUMS \ OPT_DETACH, \ + OPT_NO_CHDIR, \ OPT_PIDFILE, \ OPT_PIPE_HANDLE, \ OPT_SERVICE, \ @@ -87,6 +88,7 @@ pid_t read_pidfile(const char *name); #define DAEMON_LONG_OPTIONS \ {"detach", no_argument, NULL, OPT_DETACH}, \ + {"no-chdir", no_argument, NULL, OPT_NO_CHDIR}, \ {"pidfile", optional_argument, NULL, OPT_PIDFILE}, \ {"pipe-handle", required_argument, NULL, OPT_PIPE_HANDLE}, \ {"service", no_argument, NULL, OPT_SERVICE}, \ @@ -96,6 +98,9 @@ pid_t read_pidfile(const char *name); case OPT_DETACH: \ break; \ \ + case OPT_NO_CHDIR: \ + break; \ + \ case OPT_PIDFILE: \ set_pidfile(optarg); \ break; \ -- 2.43.0