mirror of
https://github.com/freebsd/freebsd-src
synced 2024-10-15 12:54:27 +00:00
Clarify lifetime of child(..) function
Ensure child exits when complete as it's always run in a forked process. Add a missing break statement in :pselect_sigmask when calling child(..) for clarity and to avoid weird domino effects if the child process somehow does something it's not supposed to do with the logfiles, file descriptors, etc MFC after: 1 week Reported by: Coverity CID: 1223369, 1223370, 1300301
This commit is contained in:
parent
f0ab3d3668
commit
7251167f52
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=311268
|
@ -135,6 +135,9 @@ child(const struct timespec *ts)
|
|||
"after timeout %s != %s",
|
||||
prmask(&nset, nbuf, sizeof(nbuf)),
|
||||
prmask(&oset, obuf, sizeof(obuf)));
|
||||
#ifdef __FreeBSD__
|
||||
_exit(0);
|
||||
#endif
|
||||
}
|
||||
|
||||
ATF_TC(pselect_sigmask);
|
||||
|
@ -154,6 +157,9 @@ ATF_TC_BODY(pselect_sigmask, tc)
|
|||
switch (pid = fork()) {
|
||||
case 0:
|
||||
child(NULL);
|
||||
#ifdef __FreeBSD__
|
||||
break;
|
||||
#endif
|
||||
case -1:
|
||||
err(1, "fork");
|
||||
default:
|
||||
|
|
Loading…
Reference in a new issue