diff options
author | Simon McVittie <smcv@collabora.com> | 2019-07-23 11:36:58 +0100 |
---|---|---|
committer | Simon McVittie <smcv@collabora.com> | 2019-07-23 11:37:49 +0100 |
commit | 6e29b2837f23e2c8ed568e946c76820fa066a6a7 (patch) | |
tree | c4fb255c7a589eb97f8eb3319d5f58dde005149c | |
parent | f2dbcf2c0952aff6f49809fb4e14ba1405b11084 (diff) | |
download | dbus-glib-6e29b2837f23e2c8ed568e946c76820fa066a6a7.tar.gz |
test-service: Don't close a shared connection
This is considered incorrect and causes a libdbus check failure.
Signed-off-by: Simon McVittie <smcv@collabora.com>
-rw-r--r-- | test/test-service.c | 15 |
1 files 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", |