mirror of
https://github.com/morgan9e/systemd
synced 2026-04-15 08:56:15 +09:00
core: fix status output suppression
This fixes two things: first of all it ensures we take the override status output field properly into account, instead of going directly to the regular one. Moreover, it ensures that we bypass auto for both notice + emergency, since both have the same "impact", and, don't limit this for notice only.
This commit is contained in:
@@ -4525,10 +4525,10 @@ static bool manager_should_show_status(Manager *m, StatusType type) {
|
||||
return false;
|
||||
|
||||
/* If we cannot find out the status properly, just proceed. */
|
||||
if (type != STATUS_TYPE_EMERGENCY && manager_check_ask_password(m) > 0)
|
||||
if (type < STATUS_TYPE_EMERGENCY && manager_check_ask_password(m) > 0)
|
||||
return false;
|
||||
|
||||
if (type == STATUS_TYPE_NOTICE && m->show_status != SHOW_STATUS_NO)
|
||||
if (type >= STATUS_TYPE_NOTICE && manager_get_show_status(m) != SHOW_STATUS_NO)
|
||||
return true;
|
||||
|
||||
return manager_get_show_status_on(m);
|
||||
|
||||
@@ -52,10 +52,12 @@ typedef enum OOMPolicy {
|
||||
} OOMPolicy;
|
||||
|
||||
typedef enum StatusType {
|
||||
STATUS_TYPE_EPHEMERAL,
|
||||
STATUS_TYPE_EPHEMERAL, /* ordered by severity! Do not break order */
|
||||
STATUS_TYPE_NORMAL,
|
||||
STATUS_TYPE_NOTICE,
|
||||
STATUS_TYPE_EMERGENCY,
|
||||
_STATUS_TYPE_MAX,
|
||||
_STATUS_TYPE_INVALID = -EINVAL,
|
||||
} StatusType;
|
||||
|
||||
static inline bool UNIT_IS_ACTIVE_OR_RELOADING(UnitActiveState t) {
|
||||
|
||||
Reference in New Issue
Block a user