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

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

 



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. */
   ....
 }

> +/* 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.

    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