diff options
author | Frank Osterfeld <frank@kdab.net> | 2009-10-22 13:03:11 +0300 |
---|---|---|
committer | Ralf Habacker <ralf.habacker@freenet.de> | 2009-12-01 10:28:00 +0100 |
commit | d9e4725fa93d03368a81f0aa3cb8e66800d96c65 (patch) | |
tree | 611c52b8b70a92737c175ea6f3da9ddfbeed2fe4 /bus/main.c | |
parent | 459c19b9dd157cd360c3082d015a4c5ae4689cf8 (diff) | |
download | dbus-d9e4725fa93d03368a81f0aa3cb8e66800d96c65.tar.gz |
Windows fixes
Replace dbus_daemon_init() by dbus_publish_session_bus_address(),
publishing the full address. Omit username from mutexes (not necessary
as mutex names are local to session). Don't exit if publishing the
address failed (allow multiple session bus instances per
session). Based on 00ee92ae314 by Tor Lillqvist.
Cherry-picked from commit 23945513e9a4da61d286ebfbce3897aa061ddbfe in
the dbus4win repository by tml@iki.fi. Remove claim of that commit not
being merged from README.dbus4win.
Diffstat (limited to 'bus/main.c')
-rw-r--r-- | bus/main.c | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -254,6 +254,7 @@ main (int argc, char **argv) int i; dbus_bool_t print_address; dbus_bool_t print_pid; + dbus_bool_t is_session_bus; int force_fork; if (!_dbus_string_init (&config_file)) @@ -267,6 +268,7 @@ main (int argc, char **argv) print_address = FALSE; print_pid = FALSE; + is_session_bus = FALSE; force_fork = FORK_FOLLOW_CONFIG_FILE; prev_arg = NULL; @@ -296,6 +298,7 @@ main (int argc, char **argv) } else if (strcmp (arg, "--session") == 0) { + is_session_bus = TRUE; check_two_config_files (&config_file, "session"); if (!_dbus_append_session_config_file (&config_file)) @@ -452,6 +455,9 @@ main (int argc, char **argv) exit (1); } + if (is_session_bus) + _dbus_daemon_publish_session_bus_address (bus_context_get_address (context)); + /* bus_context_new() closes the print_addr_pipe and * print_pid_pipe */ @@ -473,5 +479,8 @@ main (int argc, char **argv) bus_context_unref (context); bus_selinux_shutdown (); + if (is_session_bus) + _dbus_daemon_unpublish_session_bus_address (); + return 0; } |