Change tty default baud rate: 38400 -> 0, i.e. keep kernel default

This is a more sane default, and also what systems expect, and what
other getty implementations support.  I.e., unless specified, or set
to 0, the tty baud rate is zero -- which means do not change speed
at all.

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
Joachim Nilsson committed 2020-04-22 21:15:48 +02:00
1 parent af45166814
commit b7c1a2a198
3 files changed
+15 -11

No files matched your search

+5 -7
View File
@@ -369,15 +369,12 @@ pid_t run_getty(char *tty, char *baud, char *term, int noclear, int nowait, stru
pid = fork();
if (!pid) {
speed_t speed = B38400;
if (baud && baud[0]) {
speed = stty_parse_speed(baud);
if (B0 == speed)
logit(LOG_CRIT, "TTY %s: Invalid speed %s", tty, baud);
}
speed_t speed;
speed = stty_parse_speed(baud);
logit(LOG_INFO, "Starting built-in getty on %s, speed %u", tty, speed);
prepare_tty(tty, speed, "tty", rlimit);
if (activate_console(noclear, nowait))
_exit(getty(tty, speed, term, NULL));
}
@@ -415,6 +412,7 @@ pid_t run_getty2(char *tty, char *cmd, char *args[], int noclear, int nowait, st
dup2(fd, STDERR_FILENO);
/* Dunno speed, tell stty() to not mess with it */
logit(LOG_INFO, "Starting external getty on %s, speed %u", tty, B0);
prepare_tty(tty, B0, "getty", rlimit);
if (ioctl(STDIN_FILENO, TIOCSCTTY, 1) < 0)