summaryrefslogtreecommitdiff
path: root/src/core/dbus-job.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2018-11-29 18:48:20 +0100
committerLennart Poettering <lennart@poettering.net>2018-12-01 12:53:26 +0100
commit13142276c1bbb6562aedeb5e828a00c9b6b45d96 (patch)
treec430e1673d5af45ec08ca2c6d66908c44d613b49 /src/core/dbus-job.c
parent17407bc28d731cd3efbfc1bf56cd963585e82fe9 (diff)
downloadsystemd-13142276c1bbb6562aedeb5e828a00c9b6b45d96.tar.gz
core: before returning new job path to clients, force out JobNew signals
When a client requests a new job, let's make sure we for out the JobNew signals for it, before we return successfully from the method call. After all we shouldn't return a path that is not announced yet, as announcement of jobs should be considered part of the job setup.
Diffstat (limited to 'src/core/dbus-job.c')
-rw-r--r--src/core/dbus-job.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/core/dbus-job.c b/src/core/dbus-job.c
index acb9f55a5e..d11e58b51d 100644
--- a/src/core/dbus-job.c
+++ b/src/core/dbus-job.c
@@ -189,6 +189,21 @@ void bus_job_send_change_signal(Job *j) {
j->sent_dbus_new_signal = true;
}
+void bus_job_send_pending_change_signal(Job *j, bool including_new) {
+ assert(j);
+
+ if (!j->in_dbus_queue)
+ return;
+
+ if (!j->sent_dbus_new_signal && !including_new)
+ return;
+
+ if (MANAGER_IS_RELOADING(j->unit->manager))
+ return;
+
+ bus_job_send_change_signal(j);
+}
+
static int send_removed_signal(sd_bus *bus, void *userdata) {
_cleanup_(sd_bus_message_unrefp) sd_bus_message *m = NULL;
_cleanup_free_ char *p = NULL;