]> err.no Git - systemd/commitdiff
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 232b63e2da9df263b804fcd05c86b79c8cf04622..d3db151b181f56b2b599b826e83781440877ead4 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 267ab2646cc94d991eaefa50d0cd537e7d268822..127da23bab358664f6cda97bb6e05d8e0ee1ac51 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)