Re: [LTP] [PATCH] Verify virtual device availability

Andrea Cervesato via ltp
2024-12-11T08:00:53Z

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