Skip to content

Commit 7d54562

Browse files
authored
Merge pull request #12 from SimonFrings/bug
Use SIGTERM as default signal if SIGKILL is undefined
2 parents 27e9a3c + aa0c31a commit 7d54562

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/ProcessLauncher.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public function createDeferredShell($process)
4141
// forcefully terminate process when stream closes
4242
$stream->on('close', function () use ($process) {
4343
if ($process->isRunning()) {
44-
$process->terminate(SIGKILL);
44+
$process->terminate(defined('SIGKILL') ? SIGKILL : null);
4545
}
4646
});
4747

tests/ProcessLauncherTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public function testClosingStreamTerminatesRunningProcess()
4141
$process->stdin->expects($this->any())->method('isWritable')->willReturn(true);
4242

4343
$process->expects($this->once())->method('isRunning')->will($this->returnValue(true));
44-
$process->expects($this->once())->method('terminate')->with($this->equalTo(SIGKILL));
44+
$process->expects($this->once())->method('terminate')->with($this->equalTo(defined('SIGKILL') ? SIGKILL : null));
4545

4646
$shell = $this->processLauncher->createDeferredShell($process);
4747

0 commit comments

Comments
 (0)