X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fcore%2Fdbus.c;h=1bc83a2c2aa98e1423cd91922f6506e156e3e7de;hb=e06c73cc91e02a1a3dffdb0976fef754f1109e74;hp=fe73b0a4344038570a4f82664e3f75cb5493a1e6;hpb=5430f7f2bc7330f3088b894166bf3524a067e3d8;p=elogind.git diff --git a/src/core/dbus.c b/src/core/dbus.c index fe73b0a43..1bc83a2c2 100644 --- a/src/core/dbus.c +++ b/src/core/dbus.c @@ -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);