]> sourceware.org Git - newlib-cygwin.git/commitdiff
* winsup.api/pthread/cancel9.c: Wait in mainthread until child process has terminated.
authorThomas Pfaff <tpfaff@gmx.net>
Tue, 21 Jan 2003 20:51:14 +0000 (20:51 +0000)
committerThomas Pfaff <tpfaff@gmx.net>
Tue, 21 Jan 2003 20:51:14 +0000 (20:51 +0000)
winsup/testsuite/ChangeLog
winsup/testsuite/winsup.api/pthread/cancel9.c

index 41a36a9633aff30470a6d845db83bc9d79325619..54e88a8efd74ef3aacddc3af1183b6fcb1585578 100644 (file)
@@ -1,3 +1,8 @@
+2003-01-21  Thomas Pfaff  <tpfaff@gmx.net>
+
+       * winsup.api/pthread/cancel9.c: Wait in mainthread until child
+       process has terminated.
+
 2003-01-14  Thomas Pfaff  <tpfaff@gmx.net>
 
        * winsup.api/pthread/cancel10.c: New test.
index 7bc958a0adaf38269e44af61be6670aa6c2cd57b..f9f05cc653d2dc696c434309080038057228043b 100644 (file)
 
 #include "test.h"
 
+static pid_t pid;
+
 static void *Thread(void *punused)
 {
   int res;
-  pid_t pid = fork ();
 
+  pid = fork ();
   assert (pid != -1);
   switch (pid)
     {
@@ -61,6 +63,8 @@ static void *Thread(void *punused)
 
 int main (void)
 {
+  int res;
+
   void * result;
   pthread_t t;
 
@@ -69,6 +73,7 @@ int main (void)
   assert (pthread_cancel (t) == 0);
   assert (pthread_join (t, &result) == 0);
   assert (result == PTHREAD_CANCELED);
+  assert (waitpid (pid, &res, 0) != -1);
 
   return 0;
 }
This page took 0.033872 seconds and 5 git commands to generate.