chiark / gitweb /
journal: set the _SYSTEMD_UNIT field for messages from terminated processes
[elogind.git] / src / core / dbus.c
index fe73b0a4344038570a4f82664e3f75cb5493a1e6..1bc83a2c2aa98e1423cd91922f6506e156e3e7de 100644 (file)
@@ -1095,7 +1095,7 @@ static int bus_init_private(Manager *m) {
                         goto fail;
                 }
 
-                mkdir_parents(p+10, 0755);
+                mkdir_parents_label(p+10, 0755);
                 unlink(p+10);
                 m->private_bus = dbus_server_listen(p, &error);
                 free(p);
@@ -1167,13 +1167,15 @@ static void shutdown_connection(Manager *m, DBusConnection *c) {
         Job *j;
         Iterator i;
 
-        HASHMAP_FOREACH(j, m->jobs, i)
-                if (j->bus == c) {
-                        free(j->bus_client);
-                        j->bus_client = NULL;
-
-                        j->bus = NULL;
+        HASHMAP_FOREACH(j, m->jobs, i) {
+                JobBusClient *cl, *nextcl;
+                LIST_FOREACH_SAFE(client, cl, nextcl, j->bus_client_list) {
+                        if (cl->bus == c) {
+                                LIST_REMOVE(JobBusClient, client, j->bus_client_list, cl);
+                                free(cl);
+                        }
                 }
+        }
 
         set_remove(m->bus_connections, c);
         set_remove(m->bus_connections_for_dispatch, c);