From 467d0b81c8f3201c9b749275a67d14c988e6d337 Mon Sep 17 00:00:00 2001 From: Ralf Habacker Date: Wed, 23 Jan 2013 13:14:17 +0100 Subject: [PATCH] Let dbus-daemon not print unavailable options on windows. https://bugs.freedesktop.org/show_bug.cgi?id=42441 Reviewed-by: Simon McVittie --- bus/main.c | 30 +++++++++++++++++++++++++----- 1 files changed, 25 insertions(+), 5 deletions(-) diff --git a/bus/main.c b/bus/main.c index ca0be3c..b0080b0 100644 --- a/bus/main.c +++ b/bus/main.c @@ -125,7 +125,25 @@ signal_handler (int sig) static void usage (void) { - fprintf (stderr, DBUS_DAEMON_NAME " [--version] [--session] [--system] [--config-file=FILE] [--print-address[=DESCRIPTOR]] [--print-pid[=DESCRIPTOR]] [--fork] [--nofork] [--introspect] [--address=ADDRESS] [--systemd-activation] [--nopidfile]\n"); + fprintf (stderr, + DBUS_DAEMON_NAME + " [--version]" + " [--session]" + " [--system]" + " [--config-file=FILE]" + " [--print-address[=DESCRIPTOR]]" + " [--print-pid[=DESCRIPTOR]]" +#ifdef DBUS_UNIX + " [--fork]" + " [--nofork]" +#endif + " [--introspect]" + " [--address=ADDRESS]" +#ifdef DBUS_UNIX + " [--systemd-activation]" +#endif + " [--nopidfile]" + "\n"); exit (1); } @@ -394,6 +412,7 @@ main (int argc, char **argv) { introspect (); } +#ifdef DBUS_UNIX else if (strcmp (arg, "--nofork") == 0) { flags &= ~BUS_CONTEXT_FLAG_FORK_ALWAYS; @@ -404,14 +423,15 @@ main (int argc, char **argv) flags &= ~BUS_CONTEXT_FLAG_FORK_NEVER; flags |= BUS_CONTEXT_FLAG_FORK_ALWAYS; } - else if (strcmp (arg, "--nopidfile") == 0) - { - flags &= ~BUS_CONTEXT_FLAG_WRITE_PID_FILE; - } else if (strcmp (arg, "--systemd-activation") == 0) { flags |= BUS_CONTEXT_FLAG_SYSTEMD_ACTIVATION; } +#endif + else if (strcmp (arg, "--nopidfile") == 0) + { + flags &= ~BUS_CONTEXT_FLAG_WRITE_PID_FILE; + } else if (strcmp (arg, "--system") == 0) { check_two_config_files (&config_file, "system"); -- 1.7.4.msysgit.0