1
0
mirror of https://github.com/systemd/systemd.git synced 2024-12-23 21:35:11 +03:00

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-19 18:32:10 +01:00
parent cbd37330bc
commit 9721b19968

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);
}