8000 Fix for race condition in console output stream write · symfony/symfony@428dea6 · GitHub
[go: up one dir, main page]

Skip to content

Commit 428dea6

Browse files
Fix for race condition in console output stream write
1 parent c57e4e1 commit 428dea6

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/Symfony/Component/Console/Output/StreamOutput.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,11 @@ public function getStream()
7070
*/
7171
protected function doWrite($message, $newline)
7272
{
73-
if (false === @fwrite($this->stream, $message) || ($newline && (false === @fwrite($this->stream, PHP_EOL)))) {
73+
if ($newline) {
74+
$message .= PHP_EOL;
75+
}
76+
77+
if (false === @fwrite($this->stream, $message)) {
7478
// should never happen
7579
throw new RuntimeException('Unable to write output.');
7680
}

0 commit comments

Comments
 (0)
0