add error returns missing from protoc to prevent it from exiting with a successful return value when writing the zip file fails

pull/8409/head
Steve Rago 4 years ago
parent 4c5465e5fe
commit 57e09ad848
  1. 2
      src/google/protobuf/compiler/command_line_interface.cc

@ -586,10 +586,12 @@ bool CommandLineInterface::GeneratorContextImpl::WriteAllToZip(
if (stream.GetErrno() != 0) {
std::cerr << filename << ": " << strerror(stream.GetErrno()) << std::endl;
return false;
}
if (!stream.Close()) {
std::cerr << filename << ": " << strerror(stream.GetErrno()) << std::endl;
return false;
}
return true;

Loading…
Cancel
Save