diff options
| author | Konstantin Belousov <kib@FreeBSD.org> | 2026-02-15 16:53:48 +0000 |
|---|---|---|
| committer | Konstantin Belousov <kib@FreeBSD.org> | 2026-02-16 17:57:53 +0000 |
| commit | f90ee665d035a5e4aea0bcaa18793e683ea253ed (patch) | |
| tree | 55d0ff2f7632c5a6ce10fee64045d7b010b74636 | |
| parent | 94e4de77dec809fa5a6975e3495a41d1924c25ad (diff) | |
pdrfork(2) tests: should wait for the child to exit
Tested by: pho
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D55306
| -rw-r--r-- | tests/sys/kern/pdrfork.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/tests/sys/kern/pdrfork.c b/tests/sys/kern/pdrfork.c index 658ffe117bbb..8244a34b6577 100644 --- a/tests/sys/kern/pdrfork.c +++ b/tests/sys/kern/pdrfork.c @@ -45,9 +45,10 @@ basic_usage_tail(int pd, pid_t pid) ATF_REQUIRE_MSG(pd >= 0, "rfork did not return a process descriptor"); r = pdgetpid(pd, &pd_pid); ATF_CHECK_EQ_MSG(r, 0, "pdgetpid failed: %s", strerror(errno)); + ATF_CHECK_EQ(pd_pid, pid); /* We should be able to collect the child's status */ - waited_pid = waitpid(pid, &status, WEXITED | WNOWAIT); + waited_pid = waitpid(pid, &status, WEXITED); ATF_CHECK_EQ(waited_pid, pid); /* But after closing the process descriptor, we won't */ @@ -93,7 +94,7 @@ ATF_TC_BODY(child_gets_no_pidfd, tc) r = pdgetpid(pd, &pd_pid); ATF_CHECK_EQ_MSG(r, 0, "pdgetpid failed: %s", strerror(errno)); - waited_pid = waitpid(pid, &status, WEXITED | WNOWAIT); + waited_pid = waitpid(pid, &status, WEXITED); ATF_CHECK_EQ(waited_pid, pid); ATF_REQUIRE(WIFEXITED(status) && (WEXITSTATUS(status) == true)); |
