diff options
author | Daniel Lange <DLange@git.local> | 2023-02-05 04:25:56 +0100 |
---|---|---|
committer | Daniel Lange <DLange@git.local> | 2023-02-05 04:25:56 +0100 |
commit | f288666edc9180a2e81e6655951878124f321df6 (patch) | |
tree | da70bf44b2423f6f8e9a070c063fed79d190b489 /linux/SystemdMeter.c | |
parent | 937052b231259a47d881d539ad5748245ef55b99 (diff) | |
download | debian_htop-f288666edc9180a2e81e6655951878124f321df6.tar.gz debian_htop-f288666edc9180a2e81e6655951878124f321df6.tar.bz2 debian_htop-f288666edc9180a2e81e6655951878124f321df6.zip |
New upstream version 3.2.2upstream/3.2.2
Diffstat (limited to 'linux/SystemdMeter.c')
-rw-r--r-- | linux/SystemdMeter.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/linux/SystemdMeter.c b/linux/SystemdMeter.c index 53ae2d2..cee3231 100644 --- a/linux/SystemdMeter.c +++ b/linux/SystemdMeter.c @@ -310,8 +310,12 @@ static int valueDigitColor(unsigned int value) { static void SystemdMeter_display(ATTR_UNUSED const Object* cast, RichString* out) { char buffer[16]; int len; + int color = METER_VALUE_ERROR; - int color = (systemState && String_eq(systemState, "running")) ? METER_VALUE_OK : METER_VALUE_ERROR; + if (systemState) { + color = String_eq(systemState, "running") ? METER_VALUE_OK : + String_eq(systemState, "degraded") ? METER_VALUE_ERROR : METER_VALUE_WARN; + } RichString_writeAscii(out, CRT_colors[color], systemState ? systemState : "N/A"); RichString_appendAscii(out, CRT_colors[METER_TEXT], " ("); |