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

+4
View File
@@ -27,6 +27,7 @@
#include <sys/ttydefaults.h> /* Not included by default in musl libc */
#include <termios.h>
/* B0 means; keep kernel default */
speed_t stty_parse_speed(char *baud)
{
char *ptr;
@@ -66,6 +67,9 @@ speed_t stty_parse_speed(char *baud)
{ 4000000, B4000000 },
};
if (!baud || !baud[0])
return B0;
errno = 0;
val = strtoul(baud, &ptr, 10);
if (errno || ptr == baud)