diff options
author | Lennart Poettering <lennart@poettering.net> | 2014-03-12 22:27:13 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2014-03-12 22:27:13 +0100 |
commit | 0851062751fe5083326308b9901527fc4b234919 (patch) | |
tree | 90f594b4959eb31efcb93775f30ac76480dc4270 | |
parent | dc36d78e116a7ce4a119a527299785025c925679 (diff) |
manager: use system state enum where appropriate
-rw-r--r-- | src/core/manager.c | 23 |
1 files changed, 3 insertions, 20 deletions
diff --git a/src/core/manager.c b/src/core/manager.c index f618bed424..ce5888e840 100644 --- a/src/core/manager.c +++ b/src/core/manager.c @@ -2414,23 +2414,6 @@ int manager_reload(Manager *m) { return r; } -static bool manager_is_booting_or_shutting_down(Manager *m) { - Unit *u; - - assert(m); - - /* Is the initial job still around? */ - if (manager_get_job(m, m->default_unit_job_id)) - return true; - - /* Is there a job for the shutdown target? */ - u = manager_get_unit(m, SPECIAL_SHUTDOWN_TARGET); - if (u) - return !!u->job; - - return false; -} - bool manager_is_reloading_or_reexecuting(Manager *m) { assert(m); @@ -2804,6 +2787,9 @@ static bool manager_get_show_status(Manager *m) { if (m->no_console_output) return false; + if (!IN_SET(manager_state(m), MANAGER_STARTING, MANAGER_STOPPING)) + return false; + if (m->show_status > 0) return true; @@ -2824,9 +2810,6 @@ void manager_status_printf(Manager *m, bool ephemeral, const char *status, const if (ephemeral && m->n_on_console > 0) return; - if (!manager_is_booting_or_shutting_down(m)) - return; - va_start(ap, format); status_vprintf(status, true, ephemeral, format, ap); va_end(ap); |