Skip to content

Commit

Permalink
add error returns missing from protoc to prevent it from exiting with…
Browse files Browse the repository at this point in the history
… a successful return value when writing the zip file fails
  • Loading branch information
srago committed Mar 17, 2021
1 parent 4c5465e commit 57e09ad
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/google/protobuf/compiler/command_line_interface.cc
Expand Up @@ -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;
Expand Down

0 comments on commit 57e09ad

Please sign in to comment.