summaryrefslogtreecommitdiff
path: root/src/dbus.c
diff options
context:
space:
mode:
authorMichal Schmidt <mschmidt@redhat.com>2011-12-19 18:32:10 +0100
committerMichal Schmidt <mschmidt@redhat.com>2011-12-20 00:23:51 +0100
commit9721b19968dd80ad187d03da214a2a8d28ead3ad (patch)
tree5e32408bc8be2c54d7cc0d56c06d3c08a63e46fa /src/dbus.c
parentcbd37330bcd039587121a767280fc9fee597af6e (diff)
dbus: no sync D-Bus connection flushing
Blocking on D-Bus in a system manager could lead to deadlock.
Diffstat (limited to 'src/dbus.c')
-rw-r--r--src/dbus.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/dbus.c b/src/dbus.c
index 81b4f53434..f9250f1354 100644
--- a/src/dbus.c
+++ b/src/dbus.c
@@ -1196,7 +1196,9 @@ static void shutdown_connection(Manager *m, DBusConnection *c) {
}
dbus_connection_set_dispatch_status_function(c, NULL, NULL, NULL);
- dbus_connection_flush(c);
+ /* system manager cannot afford to block on DBus */
+ if (m->running_as != MANAGER_SYSTEM)
+ dbus_connection_flush(c);
dbus_connection_close(c);
dbus_connection_unref(c);
}