]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
core/manager: use UNIT_IS_ACTIVE_OR_RELOADING rather than hardcoding service states
authorMike Yuan <me@yhndnzj.com>
Fri, 19 Dec 2025 01:06:11 +0000 (02:06 +0100)
committerMike Yuan <me@yhndnzj.com>
Fri, 19 Dec 2025 01:18:44 +0000 (02:18 +0100)
except for SERVICE_EXITED which has to be checked manually.

src/core/manager.c

index 594e7bc2c7566c47b116e3823e303f2e7e42eae8..b627c04c12855f5ecfe212bcc1d496b597a44fe8 100644 (file)
@@ -4350,7 +4350,7 @@ static bool manager_journal_is_running(Manager *m) {
         u = manager_get_unit(m, SPECIAL_JOURNALD_SERVICE);
         if (!u)
                 return false;
-        if (!IN_SET(SERVICE(u)->state, SERVICE_RELOAD, SERVICE_RUNNING))
+        if (!UNIT_IS_ACTIVE_OR_RELOADING(unit_active_state(u)) || SERVICE(u)->state == SERVICE_EXITED)
                 return false;
 
         return true;