summaryrefslogtreecommitdiff
path: root/src/core/dbus-manager.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-manager.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-manager.c')
-rw-r--r--src/core/dbus-manager.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/core/dbus-manager.c b/src/core/dbus-manager.c
index e81e6afb04..efc626ad87 100644
--- a/src/core/dbus-manager.c
+++ b/src/core/dbus-manager.c
@@ -1470,6 +1470,7 @@ static DBusHandlerResult bus_manager_message_handler(DBusConnection *connection,
const char *name, *smode, *old_name = NULL;
JobMode mode;
Job *j;
+ JobBusClient *cl;
Unit *u;
bool b;
@@ -1527,10 +1528,11 @@ static DBusHandlerResult bus_manager_message_handler(DBusConnection *connection,
if ((r = manager_add_job(m, job_type, u, mode, true, &error, &j)) < 0)
return bus_send_error_reply(connection, message, &error, r);
- if (!(j->bus_client = strdup(message_get_sender_with_fallback(message))))
+ cl = job_bus_client_new(connection, message_get_sender_with_fallback(message));
+ if (!cl)
goto oom;
- j->bus = connection;
+ LIST_PREPEND(JobBusClient, client, j->bus_client_list, cl);
if (!(reply = dbus_message_new_method_return(message)))
goto oom;