1
0
mirror of https://github.com/danog/process.git synced 2024-11-26 12:14:43 +01:00

Use taskkill on Windows

This commit is contained in:
Niklas Keller 2021-03-30 21:47:34 +02:00
parent d2ffd35dbd
commit 37f75c10c4

View File

@ -150,8 +150,8 @@ final class Runner implements ProcessRunner
public function kill(ProcessHandle $handle)
{
/** @var Handle $handle */
// todo: send a signal to the wrapper to kill the child instead?
if (!\proc_terminate($handle->proc)) {
\exec('taskkill /F /T /PID ' . $handle->wrapperPid . ' 2>&1', $output, $exitCode);
if ($exitCode) {
throw new ProcessException("Terminating process failed");
}