git: 677bbff3991b - stable/15 - pdrfork(2) tests: should wait for the child to exit
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sat, 21 Feb 2026 09:49:55 UTC
The branch stable/15 has been updated by kib:
URL: https://cgit.FreeBSD.org/src/commit/?id=677bbff3991b09c4189e9fd9cbb800273c60a8d9
commit 677bbff3991b09c4189e9fd9cbb800273c60a8d9
Author: Konstantin Belousov <kib@FreeBSD.org>
AuthorDate: 2026-02-15 16:53:48 +0000
Commit: Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2026-02-21 09:48:58 +0000
pdrfork(2) tests: should wait for the child to exit
(cherry picked from commit f90ee665d035a5e4aea0bcaa18793e683ea253ed)
---
tests/sys/kern/pdrfork.c | 5 +++--
1 file 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));