fix bug in parameter passing to dbus-daemon in dbus-launch
authorSemun Lee <sm79.lee@samsung.com>
Tue, 5 Nov 2013 08:38:28 +0000 (17:38 +0900)
committerSemun Lee <sm79.lee@samsung.com>
Tue, 5 Nov 2013 23:47:40 +0000 (08:47 +0900)
Change-Id: I7d097c15f8dfb72f832c08813e4931dc6c2555cb

tools/dbus-launch.c

index a60db2a..2a2abbb 100644 (file)
@@ -1128,15 +1128,30 @@ main (int argc, char **argv)
         }
  #endif /* DBUS_ENABLE_EMBEDDED_TESTS */
 
-      execl (DBUS_DAEMONDIR"/dbus-daemon",
+      if (kdbus)
+        {
+          execl (DBUS_DAEMONDIR"/dbus-daemon",
              DBUS_DAEMONDIR"/dbus-daemon",
              "--fork",
              "--print-pid", write_pid_fd_as_string,
              "--print-address", write_address_fd_as_string,
-             kdbus ? "--address=kdbus:" : "",
+             "--address=kdbus:",
              config_file ? "--config-file" : "--session",
              config_file, /* has to be last in this varargs list */
              NULL);
+        }
+      else
+        {
+          execl (DBUS_DAEMONDIR"/dbus-daemon",
+             DBUS_DAEMONDIR"/dbus-daemon",
+             "--fork",
+             "--print-pid", write_pid_fd_as_string,
+             "--print-address", write_address_fd_as_string,
+             config_file ? "--config-file" : "--session",
+             config_file, /* has to be last in this varargs list */
+             NULL);
+        }
+
 
       fprintf (stderr,
                "Failed to execute message bus daemon %s: %s.  Will try again without full path.\n",
@@ -1148,15 +1163,29 @@ main (int argc, char **argv)
        * file and the dbus-daemon will not be in the install location during
        * build time.
        */
-      execlp ("dbus-daemon",
+      if (kdbus)
+        {
+          execlp ("dbus-daemon",
+              "dbus-daemon",
+              "--fork",
+              "--print-pid", write_pid_fd_as_string,
+              "--print-address", write_address_fd_as_string,
+              "--address=kdbus:",
+              config_file ? "--config-file" : "--session",
+              config_file, /* has to be last in this varargs list */
+              NULL);
+        }
+      else
+        {
+          execlp ("dbus-daemon",
               "dbus-daemon",
               "--fork",
               "--print-pid", write_pid_fd_as_string,
               "--print-address", write_address_fd_as_string,
-              kdbus ? "--address=kdbus:" : "",
               config_file ? "--config-file" : "--session",
               config_file, /* has to be last in this varargs list */
               NULL);
+        }
 
       fprintf (stderr,
                "Failed to execute message bus daemon: %s\n",