aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/libs/grpc/patches/06-shutdown.patch
blob: 9191d08c19219b151ba609bb9592f32ba5027e08 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
diff --git a/src/cpp/server/server_builder.cc b/src/cpp/server/server_builder.cc
index dffcad0..026a4bd 100644
--- a/src/cpp/server/server_builder.cc
+++ b/src/cpp/server/server_builder.cc
@@ -381,14 +381,12 @@ std::unique_ptr<grpc::Server> ServerBuilder::BuildAndStart() {
     }
   }
 
-  bool added_port = false;
   for (auto& port : ports_) {
     int r = server->AddListeningPort(port.addr, port.creds.get());
     if (!r) {
-      if (added_port) server->Shutdown();
+      server->Shutdown();
       return nullptr;
     }
-    added_port = true;
     if (port.selected_port != nullptr) {
       *port.selected_port = r;
     }