From 1a296762b3d093e1fed4e74f9251206102f68355 Mon Sep 17 00:00:00 2001 From: Konstantin Belousov Date: Thu, 3 Sep 2026 21:00:12 +0300 Subject: [PATCH] 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. */