summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2011-09-04 20:42:01 -0400
committerRich Felker <dalias@aerifal.cx>2011-09-04 20:42:01 -0400
commita5794c5f7e452b28eed4cfaa33eca959574837f6 (patch)
tree18d3175f640fb986f765a8b2c99d465a8db470a6
parent0a291040676bdb8eac311948db06bc8632f7db2b (diff)
downloadlibc-testsuite-a5794c5f7e452b28eed4cfaa33eca959574837f6.tar.gz
fix invalid test: pthread_exit in cancellation handler is UB
-rw-r--r--pthread.c3
1 files changed, 1 insertions, 2 deletions
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");