summaryrefslogtreecommitdiff
path: root/dbus.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2010-04-21 03:27:44 +0200
committerLennart Poettering <lennart@poettering.net>2010-04-21 03:27:44 +0200
commita16e112358ea8fea381ee106b89e645aed8b0a8c (patch)
treef38b204ec041c25974397a7711a105cbe7509c07 /dbus.c
parent0d9068141e07ba29483ebe8bc4aaed6aacde1562 (diff)
reload: implement reload/reexec logic
Diffstat (limited to 'dbus.c')
-rw-r--r--dbus.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/dbus.c b/dbus.c
index 6b7896b605..0054d1519e 100644
--- a/dbus.c
+++ b/dbus.c
@@ -381,6 +381,18 @@ static DBusHandlerResult system_bus_message_filter(DBusConnection *connection,
unsigned bus_dispatch(Manager *m) {
assert(m);
+ if (m->queued_message) {
+ /* 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. */
+
+ if (!dbus_connection_send(m->api_bus, m->queued_message, NULL))
+ return 0;
+
+ dbus_message_unref(m->queued_message);
+ m->queued_message = NULL;
+ }
+
if (m->request_api_bus_dispatch) {
if (dbus_connection_dispatch(m->api_bus) == DBUS_DISPATCH_COMPLETE)
m->request_api_bus_dispatch = false;
@@ -655,6 +667,11 @@ void bus_done_api(Manager *m) {
if (m->name_data_slot >= 0)
dbus_pending_call_free_data_slot(&m->name_data_slot);
+
+ if (m->queued_message) {
+ dbus_message_unref(m->queued_message);
+ m->queued_message = NULL;
+ }
}
void bus_done_system(Manager *m) {