From 51bc5d4b84ba684463ea6e335a1d761d14aa76d8 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Sun, 11 Jul 2010 04:10:28 +0200 Subject: [PATCH] dbus: get rid of last non-private busses --- src/cgroups-agent.c | 6 ++++-- src/dbus-common.c | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/cgroups-agent.c b/src/cgroups-agent.c index 232b63e2..d3db151b 100644 --- a/src/cgroups-agent.c +++ b/src/cgroups-agent.c @@ -36,7 +36,7 @@ int main(int argc, char *argv[]) { goto finish; } - if (!(bus = dbus_bus_get(DBUS_BUS_SYSTEM, &error))) { + if (!(bus = dbus_bus_get_private(DBUS_BUS_SYSTEM, &error))) { log_error("Failed to get D-Bus connection: %s", error.message); goto finish; } @@ -61,8 +61,10 @@ int main(int argc, char *argv[]) { r = 0; finish: - if (bus) + if (bus) { + dbus_connection_close(bus); dbus_connection_unref(bus); + } if (m) dbus_message_unref(m); diff --git a/src/dbus-common.c b/src/dbus-common.c index 267ab264..127da23b 100644 --- a/src/dbus-common.c +++ b/src/dbus-common.c @@ -76,7 +76,7 @@ int bus_connect(DBusBusType t, DBusConnection **_bus, bool *private, DBusError * *private = true; } else { - if (!(bus = dbus_bus_get(t, error))) + if (!(bus = dbus_bus_get_private(t, error))) return -EIO; if (private) -- 2.39.5