[LTP] [PATCH v2] Extend ioctl02 to test termio and termios

Cyril Hrubis chrubis@suse.cz
Fri Nov 3 16:47:00 CET 2023


Hi!
> +#define CMP_ATTR(term_exp, term, attr) \
> +	(flag += cmp_attr((term_exp).attr, (term).attr, #attr))
>  
> -	if (termio.c_iflag != (BRKINT | IGNPAR | INPCK | ISTRIP
> -		 | ICRNL | IUCLC | IXON | IXANY | IXOFF)) {
> -		tst_res(TFAIL, "iflag has incorrect value. %o",
> -			 termio.c_iflag);
> -		flag++;
> -	}
> +#define CMP_C_CC(term_exp, term) \
> +	(flag += cmp_c_cc(term_exp.c_cc, term.c_cc, sizeof(term.c_cc)))

The last thing that I do not like about this is that we modify the flag
variable without it being passed to the macro, this is something you get
frowned upon for in proper C circles.

The rest looks really good.

-- 
Cyril Hrubis
chrubis@suse.cz


More information about the ltp mailing list