1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2025-02-09 09:57:26 +03:00

unit : allow any unit which propagates reloads to be reloaded

This commit is contained in:
Jérémy Rosen 2017-07-22 17:30:57 +02:00 committed by Jérémy Rosen
parent 526664f627
commit f54bcca5c1

View File

@ -1759,19 +1759,25 @@ int unit_reload(Unit *u) {
unit_add_to_dbus_queue(u);
if (!UNIT_VTABLE(u)->reload) {
/* Unit doesn't have a reload function, but we need to propagate the reload anyway */
unit_notify(u, unit_active_state(u), unit_active_state(u), true);
return 0;
}
return UNIT_VTABLE(u)->reload(u);
}
bool unit_can_reload(Unit *u) {
assert(u);
if (!UNIT_VTABLE(u)->reload)
return false;
if (UNIT_VTABLE(u)->can_reload)
return UNIT_VTABLE(u)->can_reload(u);
if (!UNIT_VTABLE(u)->can_reload)
if (!set_isempty(u->dependencies[UNIT_PROPAGATES_RELOAD_TO]))
return true;
return UNIT_VTABLE(u)->can_reload(u);
return UNIT_VTABLE(u)->reload;
}
static void unit_check_unneeded(Unit *u) {