From 00d1a4bb2000bd726cf5e1093cba94b0e4f62090 Mon Sep 17 00:00:00 2001 From: Thomas Pfaff Date: Tue, 21 Jan 2003 20:51:14 +0000 Subject: * winsup.api/pthread/cancel9.c: Wait in mainthread until child process has terminated. --- winsup/testsuite/winsup.api/pthread/cancel9.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'winsup/testsuite/winsup.api/pthread') diff --git a/winsup/testsuite/winsup.api/pthread/cancel9.c b/winsup/testsuite/winsup.api/pthread/cancel9.c index 7bc958a0a..f9f05cc65 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; } -- cgit v1.2.3