]> andersk Git - moira.git/blobdiff - dbck/phase3.qc
*** empty log message ***
[moira.git] / dbck / phase3.qc
index e5540f1e4e359222e2d252ad56784a4aaa7b3547..0a85f74666cf850229329c47acb1257fbadee90f 100644 (file)
@@ -10,6 +10,8 @@
 
 #define NULL 0
 
+static char phase3_qc_rcsid[] = "$Header$";
+
 
 empty_list_check(id, l, hint)
 int id, hint;
@@ -25,16 +27,16 @@ struct list *l;
  * increments the string reference count.
  */
 
-int string_check(id)
+struct string *string_check(id)
 int id;
 {
     register struct string *s;
 
     s = (struct string *) hash_lookup(strings, id);
     if (s == NULL)
-      return(0);
+      return(s);
     s->refc++;
-    return(1);
+    return(s);
 }
 
 
@@ -54,7 +56,7 @@ noclu_mach_check(id, m, hint)
 int id, hint;
 struct machine *m;
 {
-    if (m->clucount == 0)
+    if (m->clucount == 0 && m->mach_id != 0)
       printf("Warning: machine %s is not in any clusters\n", m->name);
 }
 
@@ -63,11 +65,13 @@ phase3()
 ##{
     printf("Phase 3 - Finding unused objects\n");
 
-    dprintf("Checking machines...\n");
-    hash_step(machines, noclu_mach_check, NULL);
+    if (warn) {
+       dprintf("Checking machines...\n");
+       hash_step(machines, noclu_mach_check, NULL);
 
-    dprintf("Checking lists...\n");
-    hash_step(lists, empty_list_check, NULL);
+       dprintf("Checking lists...\n");
+       hash_step(lists, empty_list_check, NULL);
+    }
 
     dprintf("Checking strings...\n");
     hash_step(strings, unref_string_check, NULL);
This page took 0.047402 seconds and 4 git commands to generate.