diff --git a/src/Symfony/Component/Process/Pipes/WindowsPipes.php b/src/Symfony/Component/Process/Pipes/WindowsPipes.php index b2c3f4f4f373..3a1ef405f681 100644 --- a/src/Symfony/Component/Process/Pipes/WindowsPipes.php +++ b/src/Symfony/Component/Process/Pipes/WindowsPipes.php @@ -71,7 +71,7 @@ public function __construct($input, bool $haveReadSupport) } $this->lockHandles[$pipe] = $h; - if (!fclose(fopen($file, 'w')) || !$h = fopen($file, 'r')) { + if (!($h = fopen($file, 'w')) || !fclose($h) || !$h = fopen($file, 'r')) { flock($this->lockHandles[$pipe], \LOCK_UN); fclose($this->lockHandles[$pipe]); unset($this->lockHandles[$pipe]);