dbus: no sync D-Bus connection flushing

Blocking on D-Bus in a system manager could lead to deadlock.
This commit is contained in:
Michal Schmidt
2011-12-20 00:23:51 +01:00
parent cbd37330bc
commit 9721b19968
+3 -1
View File
@@ -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);
}