[gnome-keyring] daemon: Perform initialization in the main loop



commit 8a1fd0725d1d5f4ab485d2203772fccb81c63364
Author: Stef Walter <stefw gnome org>
Date:   Wed Jun 27 11:30:08 2012 +0200

    daemon: Perform initialization in the main loop
    
     * So that we can handle signals during initialization

 daemon/gkd-main.c |   12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)
---
diff --git a/daemon/gkd-main.c b/daemon/gkd-main.c
index 9ff675f..f081fb8 100644
--- a/daemon/gkd-main.c
+++ b/daemon/gkd-main.c
@@ -846,6 +846,13 @@ on_login_timeout (gpointer data)
 	return FALSE;
 }
 
+static gboolean
+on_idle_initialize (gpointer data)
+{
+	gkr_daemon_initialize_steps (run_components);
+	return FALSE; /* don't run again */
+}
+
 int
 main (int argc, char *argv[])
 {
@@ -967,9 +974,8 @@ main (int argc, char *argv[])
 	prepare_logging();
 
 	/* Remainder initialization after forking, if initialization not delayed */
-	if (!run_for_login) {
-		gkr_daemon_initialize_steps (run_components);
-	}
+	if (!run_for_login)
+		g_idle_add (on_idle_initialize, NULL);
 
 	g_main_loop_run (loop);
 



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