summaryrefslogtreecommitdiff
path: root/src/systemctl
diff options
context:
space:
mode:
authorChristian Hesse <mail@eworm.de>2022-09-30 10:26:43 +0200
committerLuca Boccassi <luca.boccassi@gmail.com>2022-09-30 15:02:50 +0100
commite879434df550c6dcfc02f23e613f4dda7f741089 (patch)
tree45a34b0f75300e32f0b89fc5d036a562d6330637 /src/systemctl
parent13556724379a52951eb1977c2b7989a0159fd77c (diff)
downloadsystemd-e879434df550c6dcfc02f23e613f4dda7f741089.tar.gz
systemctl: color ignored exit status in yellow, not red
If the executable path is prefixed with "-", an exit code of the command normally considered a failure (i.e. non-zero exit status or abnormal exit due to signal) is recorded, but has no further effect and is considered equivalent to success. Let's honor this with `systemctl status`, and color ignored exit status in yellow, not red.
Diffstat (limited to 'src/systemctl')
-rw-r--r--src/systemctl/systemctl-show.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/systemctl/systemctl-show.c b/src/systemctl/systemctl-show.c
index beeffda316..4c7094678c 100644
--- a/src/systemctl/systemctl-show.c
+++ b/src/systemctl/systemctl-show.c
@@ -584,7 +584,7 @@ static void print_status_info(
good = is_clean_exit(p->code, p->status, EXIT_CLEAN_DAEMON, NULL);
if (!good) {
- on = ansi_highlight_red();
+ on = p->ignore ? ansi_highlight_yellow() : ansi_highlight_red();
off = ansi_normal();
} else
on = off = "";