From a5794c5f7e452b28eed4cfaa33eca959574837f6 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Sun, 4 Sep 2011 20:42:01 -0400 Subject: fix invalid test: pthread_exit in cancellation handler is UB --- pthread.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'pthread.c') diff --git a/pthread.c b/pthread.c index 0fa8467..12533fa 100644 --- a/pthread.c +++ b/pthread.c @@ -62,7 +62,6 @@ static void cleanup4a2(void *arg) static void cleanup4a3(void *arg) { *(int *)arg += 3; - pthread_exit(0); } static void cleanup4a4(void *arg) @@ -169,7 +168,7 @@ int test_pthread(void) TEST(r, pthread_create(&td, 0, start4a, foo), 0, "failed to create thread"); TEST(r, pthread_cancel(td), 0, "cancelling"); TEST(r, pthread_join(td, &res), 0, "joining canceled thread"); - TEST(res, res, 0, "canceled thread exit status"); + TEST(res, res, PTHREAD_CANCELED, "canceled thread exit status"); TEST(r, foo[0], 1, "cleanup handler failed to run"); TEST(r, foo[1], 2, "cleanup handler failed to run"); TEST(r, foo[2], 3, "cleanup handler failed to run"); -- cgit v1.2.1