From 6e29b2837f23e2c8ed568e946c76820fa066a6a7 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Tue, 23 Jul 2019 11:36:58 +0100 Subject: test-service: Don't close a shared connection This is considered incorrect and causes a libdbus check failure. Signed-off-by: Simon McVittie --- test/test-service.c | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/test/test-service.c b/test/test-service.c index 9247487..1a61058 100644 --- a/test/test-service.c +++ b/test/test-service.c @@ -9,6 +9,7 @@ static dbus_bool_t already_quit = FALSE; static dbus_bool_t hello_from_self_reply_recived = FALSE; +static DBusConnection *connection = NULL; static void quit (void) @@ -31,22 +32,11 @@ check_hello_from_self_reply (DBusPendingCall *pcall, DBusMessage *reply; DBusMessage *echo_message, *echo_reply; DBusError error; - DBusConnection *connection; int type; dbus_error_init (&error); - connection = dbus_bus_get (DBUS_BUS_STARTER, &error); - if (connection == NULL) - { - fprintf (stderr, "*** Failed to open connection to activating message bus: %s\n", - error.message); - dbus_error_free (&error); - die("no memory"); - } - - echo_message = (DBusMessage *)user_data; reply = dbus_pending_call_steal_reply (pcall); @@ -325,10 +315,9 @@ main (int argc, char **argv) { DBusError error; - DBusConnection *connection; dbus_error_init (&error); - connection = dbus_bus_get (DBUS_BUS_STARTER, &error); + connection = dbus_bus_get_private (DBUS_BUS_STARTER, &error); if (connection == NULL) { fprintf (stderr, "*** Failed to open connection to activating message bus: %s\n", -- cgit v1.2.1