tty: Debug messages when TTY is not started

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
Joachim Nilsson
2016-12-25 10:35:51 +01:00
parent f68daf1b14
commit de05070ccc
+9 -3
View File
@@ -197,18 +197,24 @@ void tty_start(finit_tty_t *fitty)
int is_console = 0;
char *tty;
if (fitty->pid)
if (fitty->pid) {
_d("%s: TTY already active", fitty->name);
return;
}
tty = canonicalize(fitty->name);
if (!tty)
if (!tty) {
_d("%s: Cannot find TTY device: %s", fitty->name, strerror(errno));
return;
}
if (console && !strcmp(tty, console))
is_console = 1;
if (tty_check(tty))
if (tty_check(tty)) {
_d("%s: Not a valid TTY: %s", tty, strerror(errno));
return;
}
fitty->pid = run_getty(tty, fitty->baud, fitty->term, is_console);
}