aboutsummaryrefslogtreecommitdiffstats
path: root/src/ephy-dbus.c
diff options
context:
space:
mode:
authorChristian Persch <chpe@cvs.gnome.org>2006-04-03 19:56:01 +0800
committerChristian Persch <chpe@src.gnome.org>2006-04-03 19:56:01 +0800
commitd25608d94a39a9bbb5ec4770e1da6b68d420bb5b (patch)
treec2935a5a4663685f1d7397a652c783028cee4762 /src/ephy-dbus.c
parent64d66e03766ff4a529f2ebca534dbbcd756452a2 (diff)
downloadgsoc2013-epiphany-d25608d94a39a9bbb5ec4770e1da6b68d420bb5b.tar
gsoc2013-epiphany-d25608d94a39a9bbb5ec4770e1da6b68d420bb5b.tar.gz
gsoc2013-epiphany-d25608d94a39a9bbb5ec4770e1da6b68d420bb5b.tar.bz2
gsoc2013-epiphany-d25608d94a39a9bbb5ec4770e1da6b68d420bb5b.tar.lz
gsoc2013-epiphany-d25608d94a39a9bbb5ec4770e1da6b68d420bb5b.tar.xz
gsoc2013-epiphany-d25608d94a39a9bbb5ec4770e1da6b68d420bb5b.tar.zst
gsoc2013-epiphany-d25608d94a39a9bbb5ec4770e1da6b68d420bb5b.zip
Don't crash when we cannot connect to the system dbus. Bug #336557.
2006-04-03 Christian Persch <chpe@cvs.gnome.org> * src/ephy-dbus.c: (ephy_dbus_get_bus): * src/ephy-net-monitor.c: (ephy_net_monitor_check_for_active_device), (ephy_net_monitor_attach_to_dbus), (ephy_net_monitor_startup): Don't crash when we cannot connect to the system dbus. Bug #336557.
Diffstat (limited to 'src/ephy-dbus.c')
-rw-r--r--src/ephy-dbus.c23
1 files changed, 18 insertions, 5 deletions
diff --git a/src/ephy-dbus.c b/src/ephy-dbus.c
index 7ab1e81d4..1acd940a4 100644
--- a/src/ephy-dbus.c
+++ b/src/ephy-dbus.c
@@ -484,10 +484,19 @@ ephy_dbus_get_default (void)
return ephy_dbus_instance;
}
+/**
+ * ephy_dbus_get_bus:
+ * @dbus:
+ * @kind:
+ *
+ * Returns: the #DBusGConnection for the @kind DBUS, or %NULL
+ * if a connection could not be established.
+ */
DBusGConnection *
ephy_dbus_get_bus (EphyDbus *dbus,
EphyDbusBus kind)
{
+ EphyDbusPrivate *priv = dbus->priv;
DBusGConnection *bus = NULL;
g_return_val_if_fail (EPHY_IS_DBUS (dbus), NULL);
@@ -495,23 +504,27 @@ ephy_dbus_get_bus (EphyDbus *dbus,
if (kind == EPHY_DBUS_SYSTEM)
{
/* We connect lazily to the system bus */
- if (dbus->priv->system_bus == NULL)
+ if (priv->system_bus == NULL)
{
ephy_dbus_connect_to_system_bus (dbus, NULL);
}
- bus = dbus->priv->system_bus;
+
+ bus = priv->system_bus;
}
else if (kind == EPHY_DBUS_SESSION)
{
- bus = dbus->priv->session_bus;
+ if (priv->session_bus == NULL)
+ {
+ ephy_dbus_connect_to_session_bus (dbus, NULL);
+ }
+
+ bus = priv->session_bus;
}
else
{
g_assert_not_reached ();
}
- g_assert (bus != NULL);
-
return bus;
}