]> andersk Git - moira.git/commitdiff
fix pop counts update; keep track of modified tables
authormar <mar>
Mon, 26 Sep 1988 14:09:24 +0000 (14:09 +0000)
committermar <mar>
Mon, 26 Sep 1988 14:09:24 +0000 (14:09 +0000)
dbck/phase4.qc

index f360ac5fd76ad55042d56bcc12039c695876c746..55624e479ac6fb35f29e0f74e4380acc552be55e 100644 (file)
@@ -8,6 +8,8 @@
 #include <mit-copyright.h>
 #include "dbck.h"
 
+static char phase4_qc_rcsid[] = "$Header$";
+
 
 count_boxes(id, u, boxes)
 int id;
@@ -30,24 +32,24 @@ struct hash *boxes;
 ##int id, cnt;
 struct hash *counts;
 ##{
-##  int newval, rowcount, error;
+##  int oldval, rowcount;
 
-    newval = (int) hash_lookup(counts, id);
-    if (newval != cnt - 1) {
+    oldval = (int) hash_lookup(counts, id);
+    cnt--;
+    if (oldval != cnt) {
        printf("Count wrong on POBox machine %s; is %d in db, counted %d\n",
               ((struct machine *) hash_lookup(machines, id))->name,
-              newval, cnt - 1);
+              oldval, cnt);
        if (single_fix("Update", 1)) {
 ##         range of s is serverhosts
-##         replace s (value1 = newval) where
+##         replace s (value1 = cnt) where
 ##             s.service = "POP" and s.mach_id = id
-##         inquire_equel(rowcount = "rowcount", error = "errorno")
-           if (error != 0)
-             printf("Error = %d\n", error);
+##         inquire_equel(rowcount = "rowcount")
            if (rowcount > 0)
              printf("%d entr%s fixed\n", rowcount, rowcount==1?"y":"ies");
            else
              printf("Not fixed\n");
+           modified("serverhosts");
        }
     }
 ##}
@@ -71,6 +73,7 @@ struct nfsphys *n;
              printf("%d entr%s fixed\n", rowcount, rowcount==1?"y":"ies");
            else
              printf("Not fixed\n");
+           modified("nfsphys");
        }
     }
 ##}
@@ -114,7 +117,7 @@ count_only_setup()
 ##  retrieve (id = u.users_id, name = u.login, last = u.#last,
 ##           first = u.#first, status = u.#status, buf = u.potype,
 ##           id2 = u.pop_id, id3 = u.box_id) 
-##    where u.potype != "NONE" {
+##    where u.potype = "POP" {
        u = (struct user *) malloc(sizeof(struct user));
        strcpy(u->login, strtrim(name));
        u->potype = buf[0];
This page took 0.046965 seconds and 5 git commands to generate.