svn commit: [26032] trunk/busybox/loginutils
vapier at busybox.net
vapier at busybox.net
Thu Apr 9 07:08:04 UTC 2009
Author: vapier
Date: 2009-04-09 07:08:04 +0000 (Thu, 09 Apr 2009)
New Revision: 26032
Log:
patch by Stuart Hughes <seh at zee2.com> and Guenter <lists at gknw.net> to make "0" a special baud rate for getty where it uses this as "leave baud rate unchanged"
Modified:
trunk/busybox/loginutils/getty.c
Changeset:
Modified: trunk/busybox/loginutils/getty.c
===================================================================
--- trunk/busybox/loginutils/getty.c 2009-04-09 01:40:15 UTC (rev 26031)
+++ trunk/busybox/loginutils/getty.c 2009-04-09 07:08:04 UTC (rev 26032)
@@ -163,8 +163,14 @@
debug("entered parse_speeds\n");
while ((cp = strsep(&arg, ",")) != NULL) {
op->speeds[op->numspeed] = bcode(cp);
- if (op->speeds[op->numspeed] <= 0)
+ if (op->speeds[op->numspeed] < 0)
bb_error_msg_and_die("bad speed: %s", cp);
+ else if (op->speeds[op->numspeed] == 0) {
+ struct termios tio;
+ if (tcgetattr(1, &tio) != 0)
+ bb_error_msg_and_die("auto baudrate detection failed");
+ op->speeds[op->numspeed] = cfgetospeed(&tio);
+ }
op->numspeed++;
if (op->numspeed > MAX_SPEED)
bb_error_msg_and_die("too many alternate speeds");
More information about the busybox-cvs
mailing list