Re: [PATCH] selftests/futex: Correct pthread_create return value check

Thomas Gleixner <[email protected]>
Newsgroups org.kernel.vger.linux-kselftest,org.kernel.vger.linux-kernel
Message-ID <87mruum4f9.ffs@fw13>
On Mon, Jul 27 2026 at 11:08, Lei Zhu wrote:
> From: Lei Zhu <[email protected]>
>
> The pthread_create() functions returns 0 on success and a positive value on
> failure. Modify the return value check to correctly detect failure cases.
>
> Fixes: 14d016bd7282 ("selftests/futex: Refactor futex_wait_private_mapped_file with kselftest_harness.h")
> Signed-off-by: Lei Zhu <[email protected]>
> ---
>  .../selftests/futex/functional/futex_wait_private_mapped_file.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tools/testing/selftests/futex/functional/futex_wait_private_mapped_file.c b/tools/testing/selftests/futex/functional/futex_wait_private_mapped_file.c
> index 2a749f9b14eb..e6266c8a357e 100644
> --- a/tools/testing/selftests/futex/functional/futex_wait_private_mapped_file.c
> +++ b/tools/testing/selftests/futex/functional/futex_wait_private_mapped_file.c
> @@ -62,7 +62,7 @@ TEST(wait_private_mapped_file)
>  	int res;
>  
>  	res = pthread_create(&thr, NULL, thr_futex_wait, NULL);
> -	if (res < 0)
> +	if (res)
>  		ksft_exit_fail_msg("pthread_create error\n");

That does not apply on the locking/futex branch of the tip tree. It's
fixed already.

Thanks,

        tglx
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.