Re: [PATCH 4/8] Check virtual console for UTF-8 support

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

 



On Fri, Apr 29, 2011 at 01:35:39PM +0200, Karel Zak wrote:
> On Thu, Apr 28, 2011 at 04:56:32PM +0200, Werner Fink wrote:
> >  	/* Write the modem init string and DO NOT flush the buffers. */
> > -	if (options.flags & F_INITSTRING) {
> > +	if ((options.flags & (F_VCONSOLE|F_INITSTRING)) == F_INITSTRING) {
> >  		debug("writing init string\n");
> >  		safe_write(STDIN_FILENO, options.initstring,
> >  			   strlen(options.initstring));
> >  	}
> >  
> > -	if (!(options.flags & F_LOCAL))
> > +	if ((options.flags & (F_VCONSOLE|F_LOCAL)) == F_VCONSOLE)
> 
> This is correct, but is it readable? It would be better to add
> some macro to test console or serial tty flags:
> 
>  #define serial_tty_option(opt, flag) \
>             ((opt)->flags & (F_VCONSOLE|(flag)) == )flag))
>  
> and then:
> 
>  if (!serial_tty_option(&options, F_LOCAL)) {
>     /* Go to blocking write mode unless -L is specified. */
>    ....
>  }

Very good idea :)

> > +/* Reset virtual console on stdin to its defaults */
> > +static void reset_vc(const struct options *op)
> > +{
> 
> There is -c (F_KEEPCFLAGS) agetty option. The option should not be
> ignored or an exception for console should be documented.

Yep I've seen that doing the patch #8

   Werner

-- 
  "Having a smoking section in a restaurant is like having
          a peeing section in a swimming pool." -- Edward Burr
--
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