Use _exit instead of exit so the file descriptors aren't flushed twice in the

child processes

Submitted by: pho
This commit is contained in:
Enji Cooper 2014-11-16 05:05:18 +00:00
parent 30ae0e6d6a
commit a81c27fd8c
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=274571

View File

@ -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
}
}