[gnome-session] main: initialize gsm-system before acquring name



commit 5aff5ed2e24146f16c6eabbd4f39e9c9fc28dbb9
Author: Ray Strode <rstrode redhat com>
Date:   Tue Nov 6 15:46:42 2012 -0500

    main: initialize gsm-system before acquring name
    
    gsm-systemd makes synchronous calls to logind.  These
    calls invoke a main loop.  If we've already acquired a name
    on the session bus when the main loop is running, then we'll
    service that bus name too early.
    
    This commit initializes gsm-system before acquiring a name to
    avoid that clash.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=687804

 gnome-session/main.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/gnome-session/main.c b/gnome-session/main.c
index 2d76b8e..0ec33bb 100644
--- a/gnome-session/main.c
+++ b/gnome-session/main.c
@@ -45,6 +45,7 @@
 #include "gsm-manager.h"
 #include "gsm-session-fill.h"
 #include "gsm-store.h"
+#include "gsm-system.h"
 #include "gsm-xsmp-server.h"
 #include "gsm-fail-whale-dialog.h"
 
@@ -317,6 +318,13 @@ main (int argc, char **argv)
 
         client_store = gsm_store_new ();
 
+        /* Talk to logind before acquiring a name, since it does synchronous
+         * calls at initialization time that invoke a main loop and if we
+         * already owned a name, then we would service too early during
+         * that main loop.
+         */
+        g_object_unref (gsm_get_system ());
+
         xsmp_server = gsm_xsmp_server_new (client_store);
 
         if (!acquire_name ()) {



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]