summaryrefslogtreecommitdiff
path: root/src/core/main.c
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2016-03-16 09:27:37 -0400
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2016-03-17 09:33:56 -0400
commitdc9b58166ca062583bcc8145ab3df79b2b39b9ae (patch)
treeea5a6fb718c88a9ec24b57ee199576ea31eb4235 /src/core/main.c
parentdb6b984ba8d1a64ab1cfba6fb714cd1e70970d58 (diff)
systemd: obey systemd.log_color config
Fixes #2845.
Diffstat (limited to 'src/core/main.c')
-rw-r--r--src/core/main.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/core/main.c b/src/core/main.c
index 1783b9c7af..78701805ea 100644
--- a/src/core/main.c
+++ b/src/core/main.c
@@ -1218,10 +1218,15 @@ static int status_welcome(void) {
if (r < 0 && r != -ENOENT)
log_warning_errno(r, "Failed to read os-release file: %m");
- return status_printf(NULL, false, false,
- "\nWelcome to \x1B[%sm%s\x1B[0m!\n",
- isempty(ansi_color) ? "1" : ansi_color,
- isempty(pretty_name) ? "Linux" : pretty_name);
+ if (log_get_show_color())
+ return status_printf(NULL, false, false,
+ "\nWelcome to \x1B[%sm%s\x1B[0m!\n",
+ isempty(ansi_color) ? "1" : ansi_color,
+ isempty(pretty_name) ? "Linux" : pretty_name);
+ else
+ return status_printf(NULL, false, false,
+ "\nWelcome to %s!\n",
+ isempty(pretty_name) ? "Linux" : pretty_name);
}
static int write_container_id(void) {