summaryrefslogtreecommitdiff
path: root/src/core/dbus.c
diff options
context:
space:
mode:
authorMichal Schmidt <mschmidt@redhat.com>2012-04-20 12:28:31 +0200
committerMichal Schmidt <mschmidt@redhat.com>2012-04-20 17:12:29 +0200
commit97e6a11996855800f68dc41c13537784198c8b61 (patch)
treedf381f8225930b5adf0526d8a0a7987039b72c43 /src/core/dbus.c
parentd6a093d098054b6fe866441251ad9485c9e31584 (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.c14
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);