All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] selftests/futex: Correct pthread_create return value check
@ 2026-07-27  3:08 Lei Zhu
  2026-08-03 14:54 ` André Almeida
  2026-08-10 14:32 ` Thomas Gleixner
  0 siblings, 2 replies; 3+ messages in thread
From: Lei Zhu @ 2026-07-27  3:08 UTC (permalink / raw)
  To: tglx, mingo, peterz, dvhart, dave, andrealmeid, shuah
  Cc: linux-kernel, linux-kselftest, zhulei_szu

From: Lei Zhu <zhulei@kylinos.cn>

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 <zhulei@kylinos.cn>
---
 .../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");
 
 	ksft_print_dbg_msg("wait a while\n");
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-08-10 14:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-27  3:08 [PATCH] selftests/futex: Correct pthread_create return value check Lei Zhu
2026-08-03 14:54 ` André Almeida
2026-08-10 14:32 ` Thomas Gleixner

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.