diff options
author | Enji Cooper <ngie@FreeBSD.org> | 2014-11-16 05:05:18 +0000 |
---|---|---|
committer | Enji Cooper <ngie@FreeBSD.org> | 2014-11-16 05:05:18 +0000 |
commit | a81c27fd8cd391226ef02bd5463e22a47df09777 (patch) | |
tree | 495d8bda46dc62563aee4934aeb47708ab16f77b /contrib | |
parent | 30ae0e6d6a745b717a9a828e22b7db6ba14d4206 (diff) | |
download | src-a81c27fd8cd391226ef02bd5463e22a47df09777.tar.gz src-a81c27fd8cd391226ef02bd5463e22a47df09777.zip |
Use _exit instead of exit so the file descriptors aren't flushed twice in the
child processes
Submitted by: pho
Notes
Notes:
svn path=/head/; revision=274571
Diffstat (limited to 'contrib')
-rw-r--r-- | contrib/netbsd-tests/lib/libpthread/t_fork.c | 8 |
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 ab8806d25641..a58c1a6be5dd 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 } } |