summaryrefslogtreecommitdiffstats
path: root/contrib/netbsd-tests
diff options
context:
space:
mode:
authorngie <ngie@FreeBSD.org>2014-11-16 05:05:18 +0000
committerngie <ngie@FreeBSD.org>2014-11-16 05:05:18 +0000
commit3f6c6ff1c277f41c5ced3348b1da3a412691ba1f (patch)
tree495d8bda46dc62563aee4934aeb47708ab16f77b /contrib/netbsd-tests
parentbafd3cee870206d940f33ef3db01ad0413ef40ae (diff)
downloadFreeBSD-src-3f6c6ff1c277f41c5ced3348b1da3a412691ba1f.zip
FreeBSD-src-3f6c6ff1c277f41c5ced3348b1da3a412691ba1f.tar.gz
Use _exit instead of exit so the file descriptors aren't flushed twice in the
child processes Submitted by: pho
Diffstat (limited to 'contrib/netbsd-tests')
-rw-r--r--contrib/netbsd-tests/lib/libpthread/t_fork.c8
1 files changed, 8 insertions, 0 deletions
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
}
}
OpenPOWER on IntegriCloud