From 4ccb8e11c364feb89ec09d59b400ce5066645148 Mon Sep 17 00:00:00 2001 From: Sjoerd Langkemper Date: Sun, 18 Oct 2026 16:12:19 +0000 Subject: [PATCH] sapi/cli/tests: use kill -0 in pdeathsig test BusyBox ps, as used on Alpine, does not support -p. Check whether the worker processes still exist with the POSIX kill -0 builtin instead. The poll loop already waits for the workers to disappear, so transient zombies are handled. Use command -v instead of which to detect pgrep, and skip when shell_exec() is unavailable. --- sapi/cli/tests/php_cli_server_pdeathsig.phpt | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/sapi/cli/tests/php_cli_server_pdeathsig.phpt b/sapi/cli/tests/php_cli_server_pdeathsig.phpt index 66a76a84ccaf..c56baec058fb 100644 --- a/sapi/cli/tests/php_cli_server_pdeathsig.phpt +++ b/sapi/cli/tests/php_cli_server_pdeathsig.phpt @@ -9,7 +9,8 @@ if (!(str_contains(PHP_OS, 'Linux') || str_contains(PHP_OS, 'FreeBSD'))) { die('skip PDEATHSIG is only supported on Linux and FreeBSD'); } if (@file_exists('/.dockerenv')) die("skip Broken in Docker"); -if (!shell_exec("which pgrep")) die("skip Missing pgrep command"); +if (!function_exists('shell_exec')) die("skip shell_exec() is not available"); +if (!shell_exec("command -v pgrep")) die("skip Missing pgrep command"); ?> --FILE-- /dev/null && echo 1') !== null) { + $workers[] = $pid; + } + } + return $workers; } include "php_cli_server.inc";