]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
core: make unneeded check a bit tighter
authorLennart Poettering <lennart@poettering.net>
Mon, 26 Apr 2021 19:02:31 +0000 (21:02 +0200)
committerLennart Poettering <lennart@poettering.net>
Tue, 25 May 2021 14:03:03 +0000 (16:03 +0200)
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.

src/core/unit.c

index 8f744da2c42b452daabeb0f3023ec62222251447..32fbda98842ca1ace7ef77c7ddbd7aadbffe831b 100644 (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;