From eb06b4cd8f5f7d8d98b3c72c336429dbe32a6b67 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Fri, 30 Sep 2022 10:26:43 +0200 Subject: [PATCH] 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. (cherry picked from commit e879434df550c6dcfc02f23e613f4dda7f741089) (cherry picked from commit de08edca171be09c10e6860664497b101fc36bc6) --- src/systemctl/systemctl-show.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/systemctl/systemctl-show.c b/src/systemctl/systemctl-show.c index 9181a22eb7..a23d6677b5 100644 --- a/src/systemctl/systemctl-show.c +++ b/src/systemctl/systemctl-show.c @@ -559,7 +559,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 = "";