core: don't reset /dev/console if stdin/stdout/stderr as passed as fd in a transient service

Otherwise we might end resetting /dev/console all the time when a transient service starts or stops.

Fixes #2377
Fixes #2198
Fixes #2061
This commit is contained in:
Lennart Poettering
2016-01-28 16:25:39 +01:00
parent cd72d2044a
commit 1e22b5cda0
5 changed files with 50 additions and 25 deletions
+1 -3
View File
@@ -726,9 +726,7 @@ bool tty_is_vc_resolve(const char *tty) {
}
const char *default_term_for_tty(const char *tty) {
assert(tty);
return tty_is_vc_resolve(tty) ? "TERM=linux" : "TERM=vt220";
return tty && tty_is_vc_resolve(tty) ? "TERM=linux" : "TERM=vt220";
}
int fd_columns(int fd) {