Re: [PATCH] agetty: map NL to CR-NL on output in initial termiossettings

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Dec 10, 2012 at 01:34:39PM +0100, Dr. Werner Fink wrote:
> > --- a/term-utils/agetty.c
> > +++ b/term-utils/agetty.c
> > @@ -1091,7 +1091,8 @@ static void termio_init(struct options *op, struct termios *tp)
> >  #else
> >  	tp->c_iflag = 0;
> >  #endif
> > -	tp->c_lflag = tp->c_oflag = 0;
> > +	tp->c_lflag = 0;
> > +	tp->c_oflag &= OPOST | ONLCR;
> >  
> >  	if ((op->flags & F_KEEPCFLAGS) == 0)
> >  		tp->c_cflag = CS8 | HUPCL | CREAD | (tp->c_cflag & CLOCAL);
> 
> 
> Indeed this should work even on some strange serial consoles.
> Maybe this is also required for my patch set for sulogin as

 OK, applied to sulogin too.

> with this set sulogin supports not only virtual consoles but
> also serial consoles as well.

 It seems that we duplicate some code in sulogin and agetty. 

 See: 
    term-utils/agetty.c: termio_final()
    login-utils/sulogin.c: tcfinal()

    (and maybe also tcinit() in sulogin.c)

 would be possible to merge this code and move it to include/ttyutils.h 
 (or lib/ttyutils.c). I see small differences in the code, but not sure 
 which version is better (I guess agetty as this code is tested on more
 places).

 It would be nice to cleanup this before the next release to have only
 one place (code) where we initialize terminal attributes.
 
    Karel

-- 
 Karel Zak  <kzak@xxxxxxxxxx>
 http://karelzak.blogspot.com
--
To unsubscribe from this list: send the line "unsubscribe util-linux" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux