summaryrefslogtreecommitdiff
path: root/src/core/dbus.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2015-04-29 19:02:08 +0200
committerLennart Poettering <lennart@poettering.net>2015-04-29 19:02:08 +0200
commit8f88ecf6232fe6c46eecafad7c421096bb29b617 (patch)
treeca4bdc49aaf4249e7cdf2e8b866a4e0d2d21d498 /src/core/dbus.c
parent9030ca462bd13cd6536299814e4a71d5c5e85be9 (diff)
core: for queued reload message there is no need to store the bus explicitly
After all it can be derived from the message directly, and already is.
Diffstat (limited to 'src/core/dbus.c')
-rw-r--r--src/core/dbus.c13
1 files changed, 3 insertions, 10 deletions
diff --git a/src/core/dbus.c b/src/core/dbus.c
index 8d72502a1a..d1843aa290 100644
--- a/src/core/dbus.c
+++ b/src/core/dbus.c
@@ -55,18 +55,15 @@ int bus_send_queued_message(Manager *m) {
if (!m->queued_message)
return 0;
- assert(m->queued_message_bus);
-
/* If we cannot get rid of this message we won't dispatch any
* D-Bus messages, so that we won't end up wanting to queue
* another message. */
- r = sd_bus_send(m->queued_message_bus, m->queued_message, NULL);
+ r = sd_bus_send(NULL, m->queued_message, NULL);
if (r < 0)
log_warning_errno(r, "Failed to send queued message: %m");
m->queued_message = sd_bus_message_unref(m->queued_message);
- m->queued_message_bus = sd_bus_unref(m->queued_message_bus);
return 0;
}
@@ -1031,12 +1028,8 @@ static void destroy_bus(Manager *m, sd_bus **bus) {
j->clients = sd_bus_track_unref(j->clients);
/* Get rid of queued message on this bus */
- if (m->queued_message_bus == *bus) {
- m->queued_message_bus = sd_bus_unref(m->queued_message_bus);
-
- if (m->queued_message)
- m->queued_message = sd_bus_message_unref(m->queued_message);
- }
+ if (m->queued_message && sd_bus_message_get_bus(m->queued_message) == *bus)
+ m->queued_message = sd_bus_message_unref(m->queued_message);
/* Possibly flush unwritten data, but only if we are
* unprivileged, since we don't want to sync here */