From 3f6c6ff1c277f41c5ced3348b1da3a412691ba1f Mon Sep 17 00:00:00 2001 From: ngie Date: Sun, 16 Nov 2014 05:05:18 +0000 Subject: Use _exit instead of exit so the file descriptors aren't flushed twice in the child processes Submitted by: pho --- contrib/netbsd-tests/lib/libpthread/t_fork.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'contrib/netbsd-tests') diff --git a/contrib/netbsd-tests/lib/libpthread/t_fork.c b/contrib/netbsd-tests/lib/libpthread/t_fork.c index ab8806d..a58c1a6 100644 --- a/contrib/netbsd-tests/lib/libpthread/t_fork.c +++ b/contrib/netbsd-tests/lib/libpthread/t_fork.c @@ -61,7 +61,11 @@ print_pid(void *arg) thread_survived = 1; if (parent != getpid()) { +#ifdef __FreeBSD__ + _exit(1); +#else exit(1); +#endif } return NULL; } @@ -95,7 +99,11 @@ ATF_TC_BODY(fork, tc) ATF_REQUIRE_EQ_MSG(WEXITSTATUS(status), 0, "thread survived in child"); } else { sleep(5); +#ifdef __FreeBSD__ + _exit(thread_survived ? 1 : 0); +#else exit(thread_survived ? 1 : 0); +#endif } } -- cgit v1.1