From 15f51db91bf5296db756dc786f4bf87ad294d071 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 --- bus/main.c | 28 +++++++++++++++++++++++----- 1 files changed, 23 insertions(+), 5 deletions(-) diff --git a/bus/main.c b/bus/main.c index ca0be3c..6319756 100644 --- a/bus/main.c +++ b/bus/main.c @@ -125,7 +125,23 @@ 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]]" + " [--introspect]" + " [--address=ADDRESS]" + " [--nopidfile]" +#ifdef DBUS_UNIX + " [--fork]" + " [--nofork]" + " [--systemd-activation]" +#endif + "\n"); exit (1); } @@ -394,6 +410,7 @@ main (int argc, char **argv) { introspect (); } +#ifdef DBUS_UNIX else if (strcmp (arg, "--nofork") == 0) { flags &= ~BUS_CONTEXT_FLAG_FORK_ALWAYS; @@ -404,14 +421,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