Browse Source

gh-1412 Fix linux compile issue and amend comment

Signed-off-by: Jake Smith <jake.smith@lexisnexis.com>
Jake Smith 13 years ago
parent
commit
53838135aa
2 changed files with 9 additions and 11 deletions
  1. 6 8
      dali/base/dadfs.cpp
  2. 3 3
      tools/swapnode/swapnode.cpp

+ 6 - 8
dali/base/dadfs.cpp

@@ -7630,11 +7630,11 @@ class CInitGroups
         StringBuffer prop;
         prop.appendf("Group[@name=\"%s\"]",name);
         IPropertyTree *old = root->queryPropTree(prop.str());
-        if (group) // Not sure this should happend if !realcluster
-        {
-            if (!kind || !*kind || !streq("Spare", kind)) // I think it should need this if !realcluster (as it won't be)
-                clusternames.append(name);
-        }
+
+        // JCSMORE -I suspect this check should say if (realcluster)
+        // but prevent Spare clusters being added for now.
+        if (!kind || !*kind || !streq("Spare", kind))
+            clusternames.append(name);
         bool differs=false;
         if (old) {
             // see if identical
@@ -7656,7 +7656,7 @@ class CInitGroups
             }
             else
                 differs = (dir&&*dir);
-            if (group&&!differs) {
+            if (!differs) {
                 Owned<IPropertyTreeIterator> pe = old->getElements("Node");
                 unsigned i=0;
                 ForEach(*pe) {
@@ -7685,8 +7685,6 @@ class CInitGroups
             if (!differs || force)
                 root->removeProp(prop.str());
         }
-        if (!group)
-            return false;
         if (differs && !force)
             return false;
         IPropertyTree *val = createPTree("Group");

+ 3 - 3
tools/swapnode/swapnode.cpp

@@ -199,7 +199,7 @@ int main(int argc, const char *argv[])
             IPropertyTree *cluster = environment->queryPropTree(xpath.str());
             if (!cluster)
             {
-                PROGLOG("Unknown cluster: %s", clusterName);
+                PROGLOG("Unknown cluster: %s", clusterName.get());
                 ret = 3;
             }
             if (!ret)
@@ -303,9 +303,9 @@ int main(int argc, const char *argv[])
                             getClusterGroupName(*options, groupName);
                             VStringBuffer xpath("Thor[@group=\"%s\"]", groupName.str());
                             if (conn->queryRoot()->removeProp(xpath.str()))
-                                PROGLOG("SwapNode info for cluster %s removed", clusterName);
+                                PROGLOG("SwapNode info for cluster %s removed", clusterName.get());
                             else
-                                PROGLOG("SwapNode info for cluster %s not found", clusterName);
+                                PROGLOG("SwapNode info for cluster %s not found", clusterName.get());
                         }
                         break;
                     }