gnome-keyring r1642 - in trunk: . daemon
- From: nnielsen svn gnome org
- To: svn-commits-list gnome org
- Subject: gnome-keyring r1642 - in trunk: . daemon
- Date: Sun, 1 Mar 2009 06:05:27 +0000 (UTC)
Author: nnielsen
Date: Sun Mar 1 06:05:26 2009
New Revision: 1642
URL: http://svn.gnome.org/viewvc/gnome-keyring?rev=1642&view=rev
Log:
Don't allow multiple callers to overlap completing the daemon initialization.
This led to assertions and a crash on startup.
Modified:
trunk/ChangeLog
trunk/daemon/gkr-daemon.c
Modified: trunk/daemon/gkr-daemon.c
==============================================================================
--- trunk/daemon/gkr-daemon.c (original)
+++ trunk/daemon/gkr-daemon.c Sun Mar 1 06:05:26 2009
@@ -613,19 +613,9 @@
}
}
-gboolean
-gkr_daemon_complete_initialization(void)
+static gboolean
+gkr_daemon_complete_initialization_steps (void)
{
- /*
- * Sometimes we don't initialize the full daemon right on
- * startup. When run with --login is one such case.
- */
-
- if (initialization_completed) {
- g_message ("The daemon was already initialized.");
- return TRUE;
- }
-
/* Initialize new style PKCS#11 components */
if (!gkr_pkcs11_daemon_initialize ())
return FALSE;
@@ -650,6 +640,28 @@
return TRUE;
}
+gboolean
+gkr_daemon_complete_initialization (void)
+{
+ /*
+ * Sometimes we don't initialize the full daemon right on
+ * startup. When run with --login is one such case.
+ */
+
+ if (initialization_completed) {
+ g_message ("The daemon was already initialized.");
+ return TRUE;
+ }
+
+ /* Set this early so that two initializations don't overlap */
+ initialization_completed = TRUE;
+
+ /* But then set it back if initializing fails */
+ initialization_completed = gkr_daemon_complete_initialization_steps ();
+
+ return initialization_completed;
+}
+
int
main (int argc, char *argv[])
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]