From 25b508645b3a7233de3ff83dcc148584b0573f04 Mon Sep 17 00:00:00 2001 From: Dries Vints Date: Fri, 9 Feb 2024 08:13:45 +0100 Subject: [PATCH] Do not resolve posix calls on Windows --- src/Illuminate/Foundation/Console/ServeCommand.php | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/Illuminate/Foundation/Console/ServeCommand.php b/src/Illuminate/Foundation/Console/ServeCommand.php index 416c8a2801ae..8afd9d6fc173 100644 --- a/src/Illuminate/Foundation/Console/ServeCommand.php +++ b/src/Illuminate/Foundation/Console/ServeCommand.php @@ -140,13 +140,15 @@ protected function startProcess($hasEnvironment) return in_array($key, static::$passthroughVariables) ? [$key => $value] : [$key => false]; })->all()); - $this->trap([SIGTERM, SIGINT, SIGHUP, SIGUSR1, SIGUSR2, SIGQUIT], function ($signal) use ($process) { - if ($process->isRunning()) { - $process->stop(10, $signal); - } + if (! windows_os()) { + $this->trap([SIGTERM, SIGINT, SIGHUP, SIGUSR1, SIGUSR2, SIGQUIT], function ($signal) use ($process) { + if ($process->isRunning()) { + $process->stop(10, $signal); + } - exit; - }); + exit; + }); + } $process->start($this->handleProcessOutput());