Let dbus-daemon not print unavailable options on windows.
authorRalf Habacker <ralf.habacker@freenet.de>
Wed, 23 Jan 2013 12:14:17 +0000 (13:14 +0100)
committerSimon McVittie <simon.mcvittie@collabora.co.uk>
Thu, 20 Jun 2013 12:51:13 +0000 (13:51 +0100)
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=42441
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
bus/main.c

index 970c1de..e53e5f8 100644 (file)
@@ -131,7 +131,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);
 }
 
@@ -400,6 +416,7 @@ main (int argc, char **argv)
         {
           introspect ();
         }
+#ifdef DBUS_UNIX
       else if (strcmp (arg, "--nofork") == 0)
         {
           flags &= ~BUS_CONTEXT_FLAG_FORK_ALWAYS;
@@ -410,14 +427,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");