From ce5b73a7c3d8caefc72ac3b95490861e3ee13520 Mon Sep 17 00:00:00 2001 From: Mike Crowe Date: Wed, 19 Jun 2019 18:07:58 -0300 Subject: nptl: Convert various tests to use libsupport * nptl/eintr.c: Use libsupport. * nptl/tst-eintr1.c: Likewise. * nptl/tst-eintr2.c: Likewise. * nptl/tst-eintr3.c: Likewise. * nptl/tst-eintr4.c: Likewise. * nptl/tst-eintr5.c: Likewise. * nptl/tst-mutex-errorcheck.c: Likewise. * nptl/tst-mutex5.c: Likewise. --- nptl/tst-eintr1.c | 52 +++++++--------------------------------------------- 1 file changed, 7 insertions(+), 45 deletions(-) (limited to 'nptl/tst-eintr1.c') diff --git a/nptl/tst-eintr1.c b/nptl/tst-eintr1.c index 8134f0affd..b60b796d61 100644 --- a/nptl/tst-eintr1.c +++ b/nptl/tst-eintr1.c @@ -22,11 +22,8 @@ #include #include #include - -static int do_test (void); - -#define TEST_FUNCTION do_test () -#include "../test-skeleton.c" +#include +#include #include "eintr.c" @@ -43,37 +40,8 @@ tf1 (void *arg) { while (1) { - pthread_t th; - - int e = pthread_create (&th, NULL, tf2, NULL); - if (e != 0) - { - if (e == EINTR) - { - puts ("pthread_create returned EINTR"); - exit (1); - } - - char buf[100]; - printf ("tf1: pthread_create failed: %s\n", - strerror_r (e, buf, sizeof (buf))); - exit (1); - } - - e = pthread_join (th, NULL); - if (e != 0) - { - if (e == EINTR) - { - puts ("pthread_join returned EINTR"); - exit (1); - } - - char buf[100]; - printf ("tf1: pthread_join failed: %s\n", - strerror_r (e, buf, sizeof (buf))); - exit (1); - } + pthread_t th = xpthread_create (NULL, tf2, NULL); + xpthread_join (th); } } @@ -86,15 +54,7 @@ do_test (void) int i; for (i = 0; i < 10; ++i) { - pthread_t th; - int e = pthread_create (&th, NULL, tf1, NULL); - if (e != 0) - { - char buf[100]; - printf ("main: pthread_create failed: %s\n", - strerror_r (e, buf, sizeof (buf))); - exit (1); - } + pthread_t th = xpthread_create (NULL, tf1, NULL); } delayed_exit (3); @@ -102,3 +62,5 @@ do_test (void) (void) tf1 (NULL); return 1; } + +#include -- cgit v1.2.3