Skip to content

Commit

Permalink
[Process] Fix double-fread() when reading unix pipes
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolas-grekas committed Aug 2, 2016
1 parent 45dac4b commit ac17617
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Symfony/Component/Process/Pipes/UnixPipes.php
Expand Up @@ -120,7 +120,7 @@ public function readAndWrite($blocking, $close = false)
do {
$data = fread($pipe, self::CHUNK_SIZE);
$read[$type] .= $data;
} while (isset($data[0]));
} while (isset($data[0]) && ($close || isset($data[self::CHUNK_SIZE - 1])));

if (!isset($read[$type][0])) {
unset($read[$type]);
Expand Down

0 comments on commit ac17617

Please sign in to comment.