chiark / gitweb /
dbus: get rid of last non-private busses
authorLennart Poettering <lennart@poettering.net>
Sun, 11 Jul 2010 02:10:28 +0000 (04:10 +0200)
committerLennart Poettering <lennart@poettering.net>
Sun, 11 Jul 2010 02:10:28 +0000 (04:10 +0200)
src/cgroups-agent.c
src/dbus-common.c

index 232b63e..d3db151 100644 (file)
@@ -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);
index 267ab26..127da23 100644 (file)
@@ -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)