From 10a404640b50ca57fae0a77988ae29f23fc914c2 Mon Sep 17 00:00:00 2001 From: Ralf Habacker Date: Tue, 22 Jan 2013 19:33:44 +0100 Subject: [PATCH 1/3] Let dbus-daemon not print unavailable options on windows. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=42441 --- bus/main.c | 14 +++++++++++++- 1 Datei geändert, 13 Zeilen hinzugefügt(+), 1 Zeile entfernt(-) diff --git a/bus/main.c b/bus/main.c index ca0be3c..a76e6a6 100644 --- a/bus/main.c +++ b/bus/main.c @@ -122,10 +122,18 @@ signal_handler (int sig) } #endif /* DBUS_UNIX */ +#ifdef DBUS_WIN +#define DBUS_USAGE_OPTIONS1 "" +#define DBUS_USAGE_OPTIONS2 "" +#else +#define DBUS_USAGE_OPTIONS1 " [--fork] [--nofork]" +#define DBUS_USAGE_OPTIONS2 " [--systemd-activation]" +#endif + 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]]" DBUS_USAGE_OPTIONS1 " [--introspect] [--address=ADDRESS]" DBUS_USAGE_OPTIONS2 " [--nopidfile]\n"); exit (1); } @@ -394,6 +402,7 @@ main (int argc, char **argv) { introspect (); } +#ifndef DBUS_WIN else if (strcmp (arg, "--nofork") == 0) { flags &= ~BUS_CONTEXT_FLAG_FORK_ALWAYS; @@ -404,14 +413,17 @@ main (int argc, char **argv) flags &= ~BUS_CONTEXT_FLAG_FORK_NEVER; flags |= BUS_CONTEXT_FLAG_FORK_ALWAYS; } +#endif else if (strcmp (arg, "--nopidfile") == 0) { flags &= ~BUS_CONTEXT_FLAG_WRITE_PID_FILE; } +#ifndef DBUS_WIN else if (strcmp (arg, "--systemd-activation") == 0) { flags |= BUS_CONTEXT_FLAG_SYSTEMD_ACTIVATION; } +#endif else if (strcmp (arg, "--system") == 0) { check_two_config_files (&config_file, "system"); -- 1.7.10.4