diff options
author | Thomas Pfaff <tpfaff@gmx.net> | 2003-01-21 20:51:14 +0000 |
---|---|---|
committer | Thomas Pfaff <tpfaff@gmx.net> | 2003-01-21 20:51:14 +0000 |
commit | 00d1a4bb2000bd726cf5e1093cba94b0e4f62090 (patch) | |
tree | 9635ff098a8e133b828d0e755d6ba94093e56d98 /winsup/testsuite | |
parent | b8838e6f7574b42e83c96a008515e41da8c4a87a (diff) | |
download | newlib-00d1a4bb2000bd726cf5e1093cba94b0e4f62090.zip newlib-00d1a4bb2000bd726cf5e1093cba94b0e4f62090.tar.gz newlib-00d1a4bb2000bd726cf5e1093cba94b0e4f62090.tar.bz2 |
* winsup.api/pthread/cancel9.c: Wait in mainthread until child process has terminated.
Diffstat (limited to 'winsup/testsuite')
-rw-r--r-- | winsup/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | winsup/testsuite/winsup.api/pthread/cancel9.c | 7 |
2 files changed, 11 insertions, 1 deletions
diff --git a/winsup/testsuite/ChangeLog b/winsup/testsuite/ChangeLog index 41a36a9..54e88a8 100644 --- a/winsup/testsuite/ChangeLog +++ b/winsup/testsuite/ChangeLog @@ -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. diff --git a/winsup/testsuite/winsup.api/pthread/cancel9.c b/winsup/testsuite/winsup.api/pthread/cancel9.c index 7bc958a..f9f05cc 100644 --- a/winsup/testsuite/winsup.api/pthread/cancel9.c +++ b/winsup/testsuite/winsup.api/pthread/cancel9.c @@ -41,11 +41,13 @@ #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; } |