[LTP] [PATCH] Verify virtual device availability

Petr Vorel pvorel@suse.cz
Tue Dec 10 21:22:31 CET 2024


Hi Andrea,

...
>  static void setup(void)
>  {
>  	fd_send = open_uinput();
> +	if (fd_send == -1)
> +		tst_brk(TCONF, "Virtual device is not available");

Thinking about it twice, how about renaming the function safe_open_uinput()
and add tst_brk(TCONF, ...) there?

Function is not used in library where tst_brk(TCONF, ...) would be problematic,
therefore I would not even bother with having SAFE_OPEN_UINPUT() which would
evaluate open_uinput().

Kind regards,
Petr


More information about the ltp mailing list