Merge pull request #4043 from pherl/flush

Explicitly propagate the status of Flush().
This commit is contained in:
Jisi Liu 2017-12-13 13:28:23 -08:00 committed by GitHub
commit 8521624e93
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -170,12 +170,12 @@ size_t Message::SpaceUsedLong() const {
bool Message::SerializeToFileDescriptor(int file_descriptor) const {
io::FileOutputStream output(file_descriptor);
return SerializeToZeroCopyStream(&output);
return SerializeToZeroCopyStream(&output) && output.Flush();
}
bool Message::SerializePartialToFileDescriptor(int file_descriptor) const {
io::FileOutputStream output(file_descriptor);
return SerializePartialToZeroCopyStream(&output);
return SerializePartialToZeroCopyStream(&output) && output.Flush();
}
bool Message::SerializeToOstream(std::ostream* output) const {