From ba2c48b4658c8ed9800b9a8bdec68a2166258248 Mon Sep 17 00:00:00 2001 From: Simon Frings Date: Tue, 29 Sep 2020 11:49:43 +0200 Subject: [PATCH] Use SIGTERM as default signal if SIGKILL is undefined --- src/Zen/BaseZen.php | 2 +- tests/Zen/FunctionalBaseZenTest.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Zen/BaseZen.php b/src/Zen/BaseZen.php index 104a002..552ca13 100644 --- a/src/Zen/BaseZen.php +++ b/src/Zen/BaseZen.php @@ -55,7 +55,7 @@ public function close() $this->deferred->resolve(); if ($this->process !== null && $this->process->isRunning()) { - $this->process->terminate(SIGKILL); + $this->process->terminate(defined('SIGKILL') ? SIGKILL : null); // explicitly close all streams immediately $this->process->stdin->close(); diff --git a/tests/Zen/FunctionalBaseZenTest.php b/tests/Zen/FunctionalBaseZenTest.php index ba2aa3d..1242d25 100644 --- a/tests/Zen/FunctionalBaseZenTest.php +++ b/tests/Zen/FunctionalBaseZenTest.php @@ -76,7 +76,7 @@ public function testTerminatingProcessReturnsError() $zen->go($process); $this->loop->addTimer(0.1, function() use ($process) { - $process->terminate(SIGKILL); + $process->terminate(defined('SIGKILL') ? SIGKILL : null); $process->stdin->end(); });