1
0
mirror of https://github.com/systemd/systemd.git synced 2025-01-26 14:04:03 +03:00

core: make unneeded check a bit tighter

Let's not consider a unit unneeded while it is reloading.

Uneeded should be a pretty weak concept: if there's any doubt that
something bit be needed, then assume it is.
This commit is contained in:
Lennart Poettering 2021-04-26 21:02:31 +02:00
parent 7e9212bf1a
commit 116654d2cf

View File

@ -2008,7 +2008,7 @@ bool unit_is_unneeded(Unit *u) {
return false;
/* Don't clean up while the unit is transitioning or is even inactive. */
if (!UNIT_IS_ACTIVE_OR_RELOADING(unit_active_state(u)))
if (unit_active_state(u) != UNIT_ACTIVE)
return false;
if (u->job)
return false;