take over kernel baudrate for getty

Guenter lists at gknw.net
Tue Apr 14 05:25:21 UTC 2009


Hi Denys,
Denys Vlasenko schrieb:
> On Monday 06 April 2009 21:06, Guenter wrote:
> The patch is buggy.
> 
> parse_speeds is called from parse_args. parse_args is called before this:
> 
>         open_tty(options.tty);
>         ndelay_off(0);
>         debug("duping\n");
>         xdup2(0, 1);
>         xdup2(0, 2);
> 
> therefore parse_speeds uses wrong fd 1 here:
> 
>                 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);
>                 }
> 
> fd 1 is not open to tty we are interested in at this moment.
hmm, but how it comes that it actually works fine?
I've tested with a couple of different baudrates, and also I've applied
the patch to latest original agetty source, and it works.

> Please try attached alternative patch.
done, seems to work too so far (tested with svn r26071)...

Guen.





More information about the busybox mailing list