[LTP] [PATCH] Verify virtual device availability

Andrea Cervesato andrea.cervesato@suse.com
Wed Dec 11 09:00:24 CET 2024


Hi Petr,

On 12/10/24 21:22, Petr Vorel wrote:
> 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().
Usually SAFE_* macros just TBROK the tests, so I'm not sure about this 
approach.
Alternatives?
> Kind regards,
> Petr
Andrea


More information about the ltp mailing list