summaryrefslogtreecommitdiff
path: root/src/libsystemd/sd-bus
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2015-01-05 00:38:31 +0100
committerLennart Poettering <lennart@poettering.net>2015-01-05 01:40:51 +0100
commitb798e7baa5dc3ca6199bbff69f71a08d94299fdd (patch)
tree03d125cbc2e490c38f4139feee1fcfc45b0e4bae /src/libsystemd/sd-bus
parentea69bd41c5923f4f278a09bb7d8cb1abcfa122e1 (diff)
systemctl: fix waiting for jobs when using direct connections to PID 1 for dbus
Diffstat (limited to 'src/libsystemd/sd-bus')
-rw-r--r--src/libsystemd/sd-bus/bus-util.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/libsystemd/sd-bus/bus-util.c b/src/libsystemd/sd-bus/bus-util.c
index 29520f95d2..86b83db1be 100644
--- a/src/libsystemd/sd-bus/bus-util.c
+++ b/src/libsystemd/sd-bus/bus-util.c
@@ -1638,13 +1638,21 @@ int bus_wait_for_jobs_new(sd_bus *bus, BusWaitForJobs **ret) {
d->bus = sd_bus_ref(bus);
+ /* When we are a bus client we match by sender. Direct
+ * connections OTOH have no initialized sender field, and
+ * hence we ignore the sender then */
r = sd_bus_add_match(
bus,
&d->slot_job_removed,
+ bus->bus_client ?
"type='signal',"
"sender='org.freedesktop.systemd1',"
"interface='org.freedesktop.systemd1.Manager',"
"member='JobRemoved',"
+ "path='/org/freedesktop/systemd1'" :
+ "type='signal',"
+ "interface='org.freedesktop.systemd1.Manager',"
+ "member='JobRemoved',"
"path='/org/freedesktop/systemd1'",
match_job_removed, d);
if (r < 0)