diff options
author | Mike Frysinger <vapier@gentoo.org> | 2009-04-09 07:08:04 +0000 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2009-04-09 07:08:04 +0000 |
commit | fe013a74ff46cf53ec85d00f693ed72cbeef4eda (patch) | |
tree | 3882217d1cdf2b9722546d04ca677e5ea57f480e | |
parent | f50caac53c0e37111866316dfcb7e944fc21cf2e (diff) | |
download | busybox-w32-fe013a74ff46cf53ec85d00f693ed72cbeef4eda.tar.gz busybox-w32-fe013a74ff46cf53ec85d00f693ed72cbeef4eda.tar.bz2 busybox-w32-fe013a74ff46cf53ec85d00f693ed72cbeef4eda.zip |
patch by Stuart Hughes <seh@zee2.com> and Guenter <lists@gknw.net> to make "0" a special baud rate for getty where it uses this as "leave baud rate unchanged"
-rw-r--r-- | loginutils/getty.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/loginutils/getty.c b/loginutils/getty.c index 467316fb8..0398ea3f9 100644 --- a/loginutils/getty.c +++ b/loginutils/getty.c | |||
@@ -163,8 +163,14 @@ static void parse_speeds(struct options *op, char *arg) | |||
163 | debug("entered parse_speeds\n"); | 163 | debug("entered parse_speeds\n"); |
164 | while ((cp = strsep(&arg, ",")) != NULL) { | 164 | while ((cp = strsep(&arg, ",")) != NULL) { |
165 | op->speeds[op->numspeed] = bcode(cp); | 165 | op->speeds[op->numspeed] = bcode(cp); |
166 | if (op->speeds[op->numspeed] <= 0) | 166 | if (op->speeds[op->numspeed] < 0) |
167 | bb_error_msg_and_die("bad speed: %s", cp); | 167 | bb_error_msg_and_die("bad speed: %s", cp); |
168 | else if (op->speeds[op->numspeed] == 0) { | ||
169 | struct termios tio; | ||
170 | if (tcgetattr(1, &tio) != 0) | ||
171 | bb_error_msg_and_die("auto baudrate detection failed"); | ||
172 | op->speeds[op->numspeed] = cfgetospeed(&tio); | ||
173 | } | ||
168 | op->numspeed++; | 174 | op->numspeed++; |
169 | if (op->numspeed > MAX_SPEED) | 175 | if (op->numspeed > MAX_SPEED) |
170 | bb_error_msg_and_die("too many alternate speeds"); | 176 | bb_error_msg_and_die("too many alternate speeds"); |