1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
|
Partial fix for Gentoo bug 268846, upstream is not interested in a complete fix
that allows gnome-terminal to work when gconf-daemon cannot be run.
--
From f41c3d14bdfd533109d7d75bdbb2e2a0ab59b60c Mon Sep 17 00:00:00 2001
From: Christian Persch <chpe@gnome.org>
Date: Thu, 13 Aug 2009 12:31:11 +0000
Subject: Be more lenient in the gconf daemon check
Using gconf_ping_daemon() wasn't working right, since it returns FALSE
not only when the gconf daemon cannot be spawned, but also if the daemon
simply isn't running yet, but could be started without problems. Use
gconf_spawn_daemon() instead. Should fix problem reported in bug 564649
comment 5.
---
diff --git a/src/terminal.c b/src/terminal.c
index 41285e5..fc0cb2b 100644
--- a/src/terminal.c
+++ b/src/terminal.c
@@ -236,8 +236,8 @@ get_factory_name_for_display (const char *display_name)
}
/* Evil hack alert: this is exported from libgconf-2 but not in a public header */
-extern gboolean gconf_ping_daemon (void);
-
+extern gboolean gconf_spawn_daemon(GError** err);
+
int
main (int argc, char **argv)
{
@@ -329,7 +329,7 @@ main (int argc, char **argv)
{
g_printerr ("Failed to get the session bus: %s\nFalling back to non-factory mode.\n",
error->message);
- g_error_free (error);
+ g_clear_error (&error);
goto factory_disabled;
}
@@ -353,7 +353,7 @@ main (int argc, char **argv)
&error))
{
g_printerr ("Failed name request: %s\n", error->message);
- g_error_free (error);
+ g_clear_error (&error);
goto factory_disabled;
}
@@ -419,7 +419,7 @@ main (int argc, char **argv)
{
/* Incompatible factory version, fall back, to new instance */
g_printerr (_("Incompatible factory version; creating a new instance.\n"));
- g_error_free (error);
+ g_clear_error (&error);
goto factory_disabled;
}
@@ -449,10 +449,13 @@ factory_disabled:
/* If the gconf daemon isn't available (e.g. because there's no dbus
* session bus running), we'd crash later on. Tell the user about it
* now, and exit. See bug #561663.
+ * Don't use gconf_ping_daemon() here since the server may just not
+ * be running yet, but able to be started. See comments on bug #564649.
*/
- if (!gconf_ping_daemon ())
+ if (!gconf_spawn_daemon (&error))
{
- g_printerr ("Failed to contact the GConf daemon; exiting.\n");
+ g_printerr ("Failed to summon the GConf demon: %s\n", error->message);
+ g_error_free (error);
exit (1);
}
--
cgit v0.8.2
|