[LTP] [PATCH V4 2/3] syscalls: select: Verify that data is available to read

Cyril Hrubis chrubis@suse.cz
Wed Oct 21 14:04:34 CEST 2020


Hi!
> +	else if (!TST_RET)
> +		tst_res(TFAIL, "select() timed out %s", tc->desc);
> +	else if (TST_RET != exp_ret)
> +		tst_res(TFAIL, "select() returned incorrect value %s, expected: %d, got: %lu", tc->desc, exp_ret, TST_RET);
> +	else if (FD_ISSET(*tc->readfd, tc->readfds) && (!tc->writefd || FD_ISSET(*tc->writefd, tc->writefds)))
>  		tst_res(TPASS, "select() passed %s", tc->desc);
> +	else
> +		tst_res(TFAIL, "select() returned expected value %s, but all file descriptors aren't ready", tc->desc);

In the end I've rewritten this part to use returns in order to avoid
this if else maze with overly long lines and pushed, thanks.

I guess that we still need a test where select would clear the bits from
fd->set though, I supposes that the easiest solution would be to add
select04.c for that...

-- 
Cyril Hrubis
chrubis@suse.cz


More information about the ltp mailing list