git: 1a296762b3d0 - main - libcasper: reap zombies without requiring waitpid(2)

From: Konstantin Belousov <kib_at_FreeBSD.org>
Date: Fri, 04 Sep 2026 02:34:16 UTC
The branch main has been updated by kib:

URL: https://cgit.FreeBSD.org/src/commit/?id=1a296762b3d093e1fed4e74f9251206102f68355

commit 1a296762b3d093e1fed4e74f9251206102f68355
Author:     Konstantin Belousov <kib@FreeBSD.org>
AuthorDate: 2026-09-03 18:00:12 +0000
Commit:     Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2026-09-04 02:27:09 +0000

    libcasper: reap zombies without requiring waitpid(2)
    
    Reported and tested by: bapt
    Reviewed by:    bapt, markj
    Sponsored by:   The FreeBSD Foundation
    MFC after:      1 week
    Differential revision:  https://reviews.freebsd.org/D59348
---
 lib/libcasper/libcasper/libcasper.c | 2 +-
 lib/libcasper/libcasper/zygote.c    | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/libcasper/libcasper/libcasper.c b/lib/libcasper/libcasper/libcasper.c
index 9cc008cdb7bc..8783529d9dc0 100644
--- a/lib/libcasper/libcasper/libcasper.c
+++ b/lib/libcasper/libcasper/libcasper.c
@@ -95,7 +95,7 @@ cap_init(void)
 		return (NULL);
 	}
 
-	pid = pdfork(&pfd, 0);
+	pid = pdfork(&pfd, PD_NOWAITPID);
 	if (pid == 0) {
 		/* Child. */
 		close(sock[0]);
diff --git a/lib/libcasper/libcasper/zygote.c b/lib/libcasper/libcasper/zygote.c
index 976e391d8dcb..8295312b6593 100644
--- a/lib/libcasper/libcasper/zygote.c
+++ b/lib/libcasper/libcasper/zygote.c
@@ -149,7 +149,7 @@ zygote_main(int *sockp)
 			error = errno;
 			goto send;
 		}
-		pid = pdfork(&procfd, 0);
+		pid = pdfork(&procfd, PD_NOWAITPID);
 		switch (pid) {
 		case -1:
 			/* Failure. */