take over kernel baudrate for getty

Denys Vlasenko vda.linux at googlemail.com
Sun Apr 12 13:04:48 UTC 2009


On Sunday 12 April 2009 14:44, Denys Vlasenko wrote:
> On Thursday 09 April 2009 09:08, Mike Frysinger wrote:
> > On Monday 06 April 2009 15:06:38 Guenter wrote:
> > > Stuart Hughes schrieb:
> > > > FWIW, I wrote a hack to busybox to do this a while ago, you can find it
> > > > here (it's part of LTIB):
> > > > http://www.bitshrine.org/gpp/busybox-1.11.2-getty-nobaud-1.patch
> > >
> > > thank you very much!! That's exactly what I was after; I did just test
> > > the patch, and can confirm that it works also great for my usage.
> > > Attached the slightly modified patch based on Mike's comments.
> > 
> > merged, cheers
> 
> 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.

Please try attached patch.
--
vda
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 6.patch
Type: text/x-diff
Size: 2208 bytes
Desc: not available
URL: <http://lists.busybox.net/pipermail/busybox/attachments/20090412/576a11be/attachment.bin>


More information about the busybox mailing list