From c4773d40522e9e828f5b9d180ab15fc1bf975f5e Mon Sep 17 00:00:00 2001 From: Evan Miller Date: Tue, 20 Jul 2021 10:24:16 -0400 Subject: [PATCH] Work around setpgid error on older Apple platforms Expand the #7474 fix to Apple platforms. The issue affects older OS versions, including Mac OS X 10.4.11. --- src/postfork.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/postfork.cpp b/src/postfork.cpp index 3d1574f18..5c86ce997 100644 --- a/src/postfork.cpp +++ b/src/postfork.cpp @@ -95,7 +95,7 @@ int execute_setpgid(pid_t pid, pid_t pgroup, bool is_parent) { FLOGF_SAFE(proc_pgroup, "setpgid(2) returned EPERM. Retrying"); continue; } -#ifdef __BSD__ +#if defined(__BSD__) || defined(__APPLE__) // POSIX.1 doesn't specify that zombie processes are required to be considered extant and/or // children of the parent for purposes of setpgid(2). In particular, FreeBSD (at least up to // 12.2) does not consider a child that has already forked, exec'd, and exited to "exist"