summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon McVittie <simon.mcvittie@collabora.co.uk>2013-11-13 17:07:46 +0000
committerSimon McVittie <simon.mcvittie@collabora.co.uk>2014-01-29 19:28:29 +0000
commitb69fcaca8a6c6d60c1106178d1285ef29466c189 (patch)
treec1af2a6caf19a5128a0143ffe49aafee0ef252b4
parenta3521e21d9534bb169c4d5361537656af3b06376 (diff)
mc-debug-server: don't exit when disconnected from system bus
The session bus is our fake system bus, too. We exit when libdbus tells us we have disconnected, and ignore both the possible ways in which GDBus can kill us, in order to get coverage stats. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=27727
-rw-r--r--tests/twisted/mc-debug-server.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/twisted/mc-debug-server.c b/tests/twisted/mc-debug-server.c
index 48f02484..917a5d34 100644
--- a/tests/twisted/mc-debug-server.c
+++ b/tests/twisted/mc-debug-server.c
@@ -154,6 +154,7 @@ main (int argc, char **argv)
{
GError *error = NULL;
GDBusConnection *gdbus = NULL;
+ GDBusConnection *gdbus_system = NULL;
DBusConnection *connection = NULL;
int ret = 1;
GMainLoop *teardown_loop;
@@ -185,6 +186,18 @@ main (int argc, char **argv)
g_dbus_connection_set_exit_on_close (gdbus, FALSE);
+ gdbus_system = g_bus_get_sync (G_BUS_TYPE_SYSTEM, NULL, &error);
+
+ if (gdbus_system == NULL)
+ {
+ g_warning ("%s", error->message);
+ g_error_free (error);
+ error = NULL;
+ goto out;
+ }
+
+ g_dbus_connection_set_exit_on_close (gdbus_system, FALSE);
+
bus_daemon = tp_dbus_daemon_dup (&error);
if (bus_daemon == NULL)
@@ -238,6 +251,7 @@ out:
}
tp_clear_object (&gdbus);
+ tp_clear_object (&gdbus_system);
tp_clear_object (&bus_daemon);
dbus_shutdown ();