1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2024-10-30 06:25:25 +03:00

systemctl: fix waiting for jobs when using direct connections to PID 1 for dbus

This commit is contained in:
Lennart Poettering 2015-01-05 00:38:31 +01:00
parent ea69bd41c5
commit b798e7baa5

View File

@ -1638,13 +1638,21 @@ int bus_wait_for_jobs_new(sd_bus *bus, BusWaitForJobs **ret) {
d->bus = sd_bus_ref(bus); 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( r = sd_bus_add_match(
bus, bus,
&d->slot_job_removed, &d->slot_job_removed,
bus->bus_client ?
"type='signal'," "type='signal',"
"sender='org.freedesktop.systemd1'," "sender='org.freedesktop.systemd1',"
"interface='org.freedesktop.systemd1.Manager'," "interface='org.freedesktop.systemd1.Manager',"
"member='JobRemoved'," "member='JobRemoved',"
"path='/org/freedesktop/systemd1'" :
"type='signal',"
"interface='org.freedesktop.systemd1.Manager',"
"member='JobRemoved',"
"path='/org/freedesktop/systemd1'", "path='/org/freedesktop/systemd1'",
match_job_removed, d); match_job_removed, d);
if (r < 0) if (r < 0)