]> granicus.if.org Git - strace/commitdiff
2007-08-02 Jan Kratochvil <jan.kratochvil@redhat.com>
authorRoland McGrath <roland@redhat.com>
Fri, 3 Aug 2007 10:02:02 +0000 (10:02 +0000)
committerRoland McGrath <roland@redhat.com>
Fri, 3 Aug 2007 10:02:02 +0000 (10:02 +0000)
* test/leaderkill.c (start): Renamed to ...
(start0): ... here.
(start1): New function.
(main): Created a new spare thread.

test/leaderkill.c

index 51f0c6cec5a916b358d5cad53a968149779efc9d..a5b27a5b12ff76b8692c3c292078f5f86e3b2c74 100644 (file)
 #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);