patch by Stuart Hughes
No binary (build failed)
—
(log yok)
| @@ -163,8 +163,14 @@ static void parse_speeds(struct options *op, char *arg) | |
| 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"); | |