Эх сурвалжийг харах

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

Steve Rago 4 жил өмнө
parent
commit
57e09ad848

+ 2 - 0
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;