From: Roland McGrath Date: Fri, 3 Aug 2007 10:02:02 +0000 (+0000) Subject: 2007-08-02 Jan Kratochvil X-Git-Tag: v4.5.18~148 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a2eed4f8a176acfffca4370e8a48f2c14bd7635c;p=strace 2007-08-02 Jan Kratochvil * test/leaderkill.c (start): Renamed to ... (start0): ... here. (start1): New function. (main): Created a new spare thread. --- diff --git a/test/leaderkill.c b/test/leaderkill.c index 51f0c6ce..a5b27a5b 100644 --- a/test/leaderkill.c +++ b/test/leaderkill.c @@ -13,15 +13,23 @@ #include #include -static void *start (void *arg) +static void *start0 (void *arg) { sleep (1); exit (42); } +static void *start1 (void *arg) +{ + pause (); + /* NOTREACHED */ + assert (0); +} + int main (void) { + pthread_t thread0; pthread_t thread1; int i; pid_t child, got_pid; @@ -35,16 +43,13 @@ int main (void) case -1: abort (); case 0: - i = pthread_create (&thread1, NULL, start, NULL); + i = pthread_create (&thread0, NULL, start0, NULL); + assert (i == 0); + i = pthread_create (&thread1, NULL, start1, NULL); assert (i == 0); -/* Two possible testcases; the second one passed even in the older versions. */ -#if 1 pause (); -#else - pthread_exit (NULL); -#endif /* NOTREACHED */ - abort (); + assert (0); break; default: got_pid = waitpid (child, &status, 0);