summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRay Strode <rstrode@redhat.com>2009-12-21 11:14:54 -0500
committerRay Strode <rstrode@redhat.com>2009-12-21 11:21:28 -0500
commit2418840248f07025ad0edc96ed17e03ce5e47f3e (patch)
treeba1912e9ef33e1862cafd81ff770f1caf092b027
parentfc2870a65f6b3ed3b71bcac69c5faf3a9c759c64 (diff)
Don't take bus name until ready
Previously, we would take a bus name right away, but not register the manager object until later. This causes a race when being activated by a method call on the manager object, where ConsoleKit gets started but the method call fails. https://bugs.freedesktop.org/show_bug.cgi?id=25744
-rw-r--r--src/main.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/main.c b/src/main.c
index 809c6d6..b8f698f 100644
--- a/src/main.c
+++ b/src/main.c
@@ -294,11 +294,19 @@ main (int argc,
setup_debug_log (debug);
+ g_debug ("initializing console-kit-daemon %s", VERSION);
+
connection = get_system_bus ();
if (connection == NULL) {
goto out;
}
+ manager = ck_manager_new ();
+
+ if (manager == NULL) {
+ goto out;
+ }
+
bus_proxy = get_bus_proxy (connection);
if (bus_proxy == NULL) {
g_warning ("Could not construct bus_proxy object; bailing out");
@@ -310,16 +318,8 @@ main (int argc,
goto out;
}
- g_debug ("initializing console-kit-daemon %s", VERSION);
-
create_pid_file ();
- manager = ck_manager_new ();
-
- if (manager == NULL) {
- goto out;
- }
-
loop = g_main_loop_new (NULL, FALSE);
g_signal_connect (bus_proxy,