summaryrefslogtreecommitdiff
path: root/src/core/main.c
diff options
context:
space:
mode:
authorDaniel Mack <github@zonque.org>2016-03-17 20:30:16 +0100
committerDaniel Mack <github@zonque.org>2016-03-17 20:30:16 +0100
commitda9a4daa08f84db68f7620d2e926690542c31689 (patch)
treea4e9a42fae3ed21388c9afc83adad7e99d5556a7 /src/core/main.c
parent90e644608ebf94f5f3c8acb1317bf4723826e337 (diff)
parentdc9b58166ca062583bcc8145ab3df79b2b39b9ae (diff)
Merge pull request #2854 from keszybz/log-colors
systemd: obey systemd.log_color config
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) {