From 7e1e97aff3f9dc93dd017cc752d47bc35e0f39fc Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Thu, 29 Aug 2013 11:49:00 +0100 Subject: [PATCH 1/6] Allow dbus-daemon --nofork on Windows On Windows, the dbus-daemon is not able to fork (daemonize). If someone explicitly requests forking, it should fail, but if someone explicitly requests *not* forking, there seems no harm in allowing it. A few of the regression tests specifically require a dbus-daemon that will not fork, so allowing this option on Windows means those tests don't need an extra OS condition. --- bus/main.c | 4 ++-- doc/dbus-daemon.1.xml.in | 14 ++++++++++---- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/bus/main.c b/bus/main.c index 53a77e2..472458e 100644 --- a/bus/main.c +++ b/bus/main.c @@ -138,9 +138,9 @@ usage (void) " [--introspect]" " [--address=ADDRESS]" " [--nopidfile]" + " [--nofork]" #ifdef DBUS_UNIX " [--fork]" - " [--nofork]" " [--systemd-activation]" #endif "\n"); @@ -412,12 +412,12 @@ main (int argc, char **argv) { introspect (); } -#ifdef DBUS_UNIX else if (strcmp (arg, "--nofork") == 0) { flags &= ~BUS_CONTEXT_FLAG_FORK_ALWAYS; flags |= BUS_CONTEXT_FLAG_FORK_NEVER; } +#ifdef DBUS_UNIX else if (strcmp (arg, "--fork") == 0) { flags &= ~BUS_CONTEXT_FLAG_FORK_NEVER; diff --git a/doc/dbus-daemon.1.xml.in b/doc/dbus-daemon.1.xml.in index aea2514..023beba 100644 --- a/doc/dbus-daemon.1.xml.in +++ b/doc/dbus-daemon.1.xml.in @@ -89,10 +89,16 @@ with SIGHUP. Force the message bus to fork and become a daemon, even if the configuration file does not specify that it should. In most contexts the configuration file already gets this -right, though. - -Force the message bus not to fork and become a daemon, even if -the configuration file specifies that it should. +right, though. This option is not supported on Windows. + + + + + + Force the message bus not to fork and become a daemon, even if + the configuration file specifies that it should. On Windows, + the dbus-daemon never forks, so this option is allowed but does + nothing. -- 1.8.4.rc3