summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorRoland McGrath <roland@redhat.com>2007-08-03 10:02:02 +0000
committerRoland McGrath <roland@redhat.com>2007-08-03 10:02:02 +0000
commita2eed4f8a176acfffca4370e8a48f2c14bd7635c (patch)
treec9b9fe19cb6bfcf6e6cd805ad2595bbe49733ede /test
parent1bfd31032538222fa7d6b5d1741f1a4efa0eb739 (diff)
downloadstrace-a2eed4f8a176acfffca4370e8a48f2c14bd7635c.tar.gz
strace-a2eed4f8a176acfffca4370e8a48f2c14bd7635c.tar.bz2
strace-a2eed4f8a176acfffca4370e8a48f2c14bd7635c.tar.xz
2007-08-02 Jan Kratochvil <jan.kratochvil@redhat.com>
* test/leaderkill.c (start): Renamed to ... (start0): ... here. (start1): New function. (main): Created a new spare thread.
Diffstat (limited to 'test')
-rw-r--r--test/leaderkill.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/test/leaderkill.c b/test/leaderkill.c
index 51f0c6c..a5b27a5 100644
--- a/test/leaderkill.c
+++ b/test/leaderkill.c
@@ -13,15 +13,23 @@
#include <stdio.h>
#include <sys/wait.h>
-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);