summaryrefslogtreecommitdiff
path: root/nptl/tst-atfork1.c
diff options
context:
space:
mode:
Diffstat (limited to 'nptl/tst-atfork1.c')
-rw-r--r--nptl/tst-atfork1.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/nptl/tst-atfork1.c b/nptl/tst-atfork1.c
index 25bd3f2f09..b42ab42469 100644
--- a/nptl/tst-atfork1.c
+++ b/nptl/tst-atfork1.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002 Free Software Foundation, Inc.
+/* Copyright (C) 2002, 2003 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -17,10 +17,12 @@
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
+#include <errno.h>
#include <pthread.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
+#include <sys/wait.h>
static int val;
@@ -67,6 +69,7 @@ static int
do_test (void)
{
pid_t pid;
+ int status = 0;
if (pthread_atfork (prepare1, parent1, child1) != 0)
{
@@ -94,6 +97,12 @@ do_test (void)
printf ("expected val=%d, got %d\n", 24, val);
exit (1);
}
+
+ if (TEMP_FAILURE_RETRY (waitpid (pid, &status, 0)) != pid)
+ {
+ puts ("waitpid failed");
+ exit (1);
+ }
}
else
{
@@ -101,11 +110,11 @@ do_test (void)
if (val != 80)
{
printf ("expected val=%d, got %d\n", 80, val);
- exit (1);
+ exit (2);
}
}
- return 0;
+ return status;
}
#define TEST_FUNCTION do_test ()