[LTP] [PATCH v1] Change the fd validity check to < 0

Andrea Cervesato andrea.cervesato@suse.com
Thu Mar 12 13:52:04 CET 2026


Hi!

> ---
>  testcases/kernel/controllers/cgroup/cgroup_core02.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/testcases/kernel/controllers/cgroup/cgroup_core02.c b/testcases/kernel/controllers/cgroup/cgroup_core02.c
> index aba387197..a5c8c9684 100644
> --- a/testcases/kernel/controllers/cgroup/cgroup_core02.c
> +++ b/testcases/kernel/controllers/cgroup/cgroup_core02.c
> @@ -77,8 +77,8 @@ static void test_lesser_ns_open(void)
>  		SAFE_MUNMAP(stack, STACK_SIZE);
>  
>  		for (i = 0; i < targ.loops; i++) {
> -			if (targ.fds[i] < 1) {
> -				tst_res(TFAIL, "unexpected negative fd %d", targ.fds[i]);
> +			if (targ.fds[i] < 0) {
> +				tst_res(TFAIL, "unexpected invalid fd %d", targ.fds[i]);
>  				exit(1);
>  			}
>  
> -- 
> 2.20.1
> 
> 
> -- 
> Mailing list info: https://lists.linux.it/listinfo/ltp

Technically, the message is not matching the logic, but is there a particular
case why you think this patch is needed?

Kind regards,
--
Andrea Cervesato
SUSE QE Automation Engineer Linux
andrea.cervesato@suse.com


More information about the ltp mailing list