Destruct CodedOutputStream instead of using Trim()

pull/7208/head
Martin Pärtel 5 years ago committed by Adam Cozzette
parent f6902d6afe
commit 82a057596e
  1. 4
      src/google/protobuf/compiler/command_line_interface.cc

@ -2229,6 +2229,7 @@ bool CommandLineInterface::WriteDescriptorSet(
io::FileOutputStream out(fd); io::FileOutputStream out(fd);
{
io::CodedOutputStream coded_out(&out); io::CodedOutputStream coded_out(&out);
// Determinism is useful here because build outputs are sometimes checked // Determinism is useful here because build outputs are sometimes checked
// into version control. // into version control.
@ -2239,7 +2240,8 @@ bool CommandLineInterface::WriteDescriptorSet(
out.Close(); out.Close();
return false; return false;
} }
coded_out.Trim(); }
if (!out.Close()) { if (!out.Close()) {
std::cerr << descriptor_set_out_name_ << ": " << strerror(out.GetErrno()) std::cerr << descriptor_set_out_name_ << ": " << strerror(out.GetErrno())
<< std::endl; << std::endl;

Loading…
Cancel
Save