Parcourir la source

[2209] Rewrite the reload() wrapper

Some people found the previous hard to follow.
Michal 'vorner' Vaner il y a 12 ans
Parent
commit
0c8f4961f3
1 fichiers modifiés avec 9 ajouts et 5 suppressions
  1. 9 5
      src/lib/datasrc/client_list.cc

+ 9 - 5
src/lib/datasrc/client_list.cc

@@ -346,12 +346,16 @@ ConfigurableClientList::findInternal(MutableResult& candidate,
 ConfigurableClientList::ReloadResult
 ConfigurableClientList::reload(const Name& name) {
     const ZoneWriterPair result(getCachedZoneWriter(name));
-    if (result.second) {
-        result.second->load();
-        result.second->install();
-        result.second->cleanup();
+    if (result.first != ZONE_SUCCESS) {
+        return (result.first);
     }
-    return (result.first);
+
+    assert(result.second);
+    result.second->load();
+    result.second->install();
+    result.second->cleanup();
+
+    return (ZONE_SUCCESS);
 }
 
 namespace {