pid1: disable color output when TERM=dumb

This changes the behaviour of pid1 in the following ways:
- obviously $TERM is now checked,
- $SYSTEMD_COLORS is now honoured too, before only SYSTEMD_LOG_COLORS was checked,
- isatty() is run on stdout not stderr.

As requested in #3025.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek
2016-04-20 09:00:39 -04:00
parent 4d46e5db15
commit d5ca5e1324
+1 -1
View File
@@ -1338,7 +1338,7 @@ int main(int argc, char *argv[]) {
saved_argv = argv;
saved_argc = argc;
log_show_color(isatty(STDERR_FILENO) > 0);
log_show_color(colors_enabled());
log_set_upgrade_syslog_to_journal(true);
/* Disable the umask logic */