tty: Debug messages when TTY is not started

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