X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;ds=sidebyside;f=tools%2Fdbus-launch.c;h=2a2abbbf8572c5b0ddd5b586303515b9ff6d096e;hb=16ed767007722d7450e6f5a4e23fff0166f466dc;hp=80e1419d661accbaee50bbf4c3ce03b0614a874f;hpb=eec093bbdb14d17d9d1cc01bca3fff7f1d3931e7;p=platform%2Fupstream%2Fdbus.git diff --git a/tools/dbus-launch.c b/tools/dbus-launch.c index 80e1419..2a2abbb 100644 --- a/tools/dbus-launch.c +++ b/tools/dbus-launch.c @@ -823,6 +823,7 @@ main (int argc, char **argv) int autolaunch = FALSE; int requires_arg = FALSE; int close_stderr = FALSE; + int kdbus = FALSE; int i; int ret; int bus_pid_to_launcher_pipe[2]; @@ -859,6 +860,8 @@ main (int argc, char **argv) exit_with_session = TRUE; else if (strcmp (arg, "--close-stderr") == 0) close_stderr = TRUE; + else if (strcmp (arg, "--kdbus") == 0) + kdbus = TRUE; else if (strstr (arg, "--autolaunch=") == arg) { const char *s; @@ -1106,7 +1109,7 @@ main (int argc, char **argv) verbose ("Calling exec()\n"); -#ifdef DBUS_BUILD_TESTS +#ifdef DBUS_ENABLE_EMBEDDED_TESTS /* exec from testdir */ if (getenv("DBUS_USE_TEST_BINARY") != NULL) { @@ -1123,16 +1126,32 @@ main (int argc, char **argv) "Failed to execute test message bus daemon %s: %s. Will try again with the system path.\n", TEST_BUS_BINARY, strerror (errno)); } - #endif /* DBUS_BUILD_TESTS */ + #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, + "--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", @@ -1144,7 +1163,21 @@ 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, @@ -1152,6 +1185,7 @@ main (int argc, char **argv) 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",