summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorFranck Bui <fbui@suse.com>2016-06-10 18:33:15 +0200
committerLennart Poettering <lennart@poettering.net>2016-06-10 18:33:15 +0200
commit64c3610b55799c738e4fdc7236fadd635649c0f4 (patch)
tree988866241bcfe00fcd0c39a0da76dfa9a3cafa6e /src/core
parentf8afc2a9bad864fc1df3ed523f782a7e822d4485 (diff)
core: disable colors when displaying cylon when systemd.log_color=off (#3495)
Diffstat (limited to 'src/core')
-rw-r--r--src/core/manager.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/core/manager.c b/src/core/manager.c
index 14d97a87d0..ec8acdff5b 100644
--- a/src/core/manager.c
+++ b/src/core/manager.c
@@ -136,23 +136,28 @@ static void draw_cylon(char buffer[], size_t buflen, unsigned width, unsigned po
if (pos > 1) {
if (pos > 2)
p = mempset(p, ' ', pos-2);
- p = stpcpy(p, ANSI_RED);
+ if (log_get_show_color())
+ p = stpcpy(p, ANSI_RED);
*p++ = '*';
}
if (pos > 0 && pos <= width) {
- p = stpcpy(p, ANSI_HIGHLIGHT_RED);
+ if (log_get_show_color())
+ p = stpcpy(p, ANSI_HIGHLIGHT_RED);
*p++ = '*';
}
- p = stpcpy(p, ANSI_NORMAL);
+ if (log_get_show_color())
+ p = stpcpy(p, ANSI_NORMAL);
if (pos < width) {
- p = stpcpy(p, ANSI_RED);
+ if (log_get_show_color())
+ p = stpcpy(p, ANSI_RED);
*p++ = '*';
if (pos < width-1)
p = mempset(p, ' ', width-1-pos);
- strcpy(p, ANSI_NORMAL);
+ if (log_get_show_color())
+ strcpy(p, ANSI_NORMAL);
}
}