summaryrefslogtreecommitdiff
path: root/compiler/buffered_output_stream.cc
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/buffered_output_stream.cc')
-rw-r--r--compiler/buffered_output_stream.cc7
1 files changed, 4 insertions, 3 deletions
diff --git a/compiler/buffered_output_stream.cc b/compiler/buffered_output_stream.cc
index 0940a80cc1..3ca518b686 100644
--- a/compiler/buffered_output_stream.cc
+++ b/compiler/buffered_output_stream.cc
@@ -25,12 +25,13 @@ BufferedOutputStream::BufferedOutputStream(OutputStream* out)
bool BufferedOutputStream::WriteFully(const void* buffer, size_t byte_count) {
if (byte_count > kBufferSize) {
- Flush();
+ if (!Flush()) {
+ return false;
+ }
return out_->WriteFully(buffer, byte_count);
}
if (used_ + byte_count > kBufferSize) {
- bool success = Flush();
- if (!success) {
+ if (!Flush()) {
return false;
}
}