فهرست منبع

Merge pull request #8409 from srago/protoc-fix

add error returns missing from protoc to prevent it from exiting with…
Adam Cozzette 4 سال پیش
والد
کامیت
617e255617
1فایلهای تغییر یافته به همراه2 افزوده شده و 0 حذف شده
  1. 2 0
      src/google/protobuf/compiler/command_line_interface.cc

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