diff options
author | Michal Schmidt <mschmidt@redhat.com> | 2012-04-20 12:28:31 +0200 |
---|---|---|
committer | Michal Schmidt <mschmidt@redhat.com> | 2012-04-20 17:12:29 +0200 |
commit | 97e6a11996855800f68dc41c13537784198c8b61 (patch) | |
tree | df381f8225930b5adf0526d8a0a7987039b72c43 /src/core/dbus.c | |
parent | d6a093d098054b6fe866441251ad9485c9e31584 (diff) |
dbus-job: allow multiple bus clients
Merging of jobs can result in more than one client being interested in a job.
Diffstat (limited to 'src/core/dbus.c')
-rw-r--r-- | src/core/dbus.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/core/dbus.c b/src/core/dbus.c index fe73b0a434..434796456b 100644 --- a/src/core/dbus.c +++ b/src/core/dbus.c @@ -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); |