diff --git a/src/Symfony/Component/Process/Pipes/WindowsPipes.php b/src/Symfony/Component/Process/Pipes/WindowsPipes.php index db66c672a7dae..7b2e5b4b23c3d 100644 --- a/src/Symfony/Component/Process/Pipes/WindowsPipes.php +++ b/src/Symfony/Component/Process/Pipes/WindowsPipes.php @@ -51,9 +51,10 @@ public function __construct($disableOutput, $input) Process::STDOUT => Process::OUT, Process::STDERR => Process::ERR, ); + $tmpCheck = false; $tmpDir = sys_get_temp_dir(); - $error = 'unknown reason'; - set_error_handler(function ($type, $msg) use (&$error) { $error = $msg; }); + $lastError = 'unknown reason'; + set_error_handler(function ($type, $msg) use (&$lastError) { $lastError = $msg; }); for ($i = 0;; ++$i) { foreach ($pipes as $pipe => $name) { $file = sprintf('%s\\sf_proc_%02X.%s', $tmpDir, $i, $name); @@ -61,7 +62,11 @@ public function __construct($disableOutput, $input) continue 2; } $h = fopen($file, 'xb'); - if (!$h && false === strpos($error, 'File exists')) { + if (!$h) { + $error = $lastError; + if ($tmpCheck || $tmpCheck = unlink(tempnam(false, 'sf_check_'))) { + continue; + } restore_error_handler(); throw new RuntimeException(sprintf('A temporary file could not be opened to write the process output: %s', $error)); }
Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.
Alternative Proxies: