]> andersk Git - moira.git/blobdiff - dbck/phase4.pc
Command line printer manipulation client, and build goo.
[moira.git] / dbck / phase4.pc
index 052f5c28066a2164aa6696050a908634e9edad3e..eb8f3d21d7b68a6dffac1e8d2d662de800cd4af2 100644 (file)
@@ -77,18 +77,21 @@ void check_nfs_counts(int id, void *nfsphys, void *hint)
 {
   struct nfsphys *n = nfsphys;
   EXEC SQL BEGIN DECLARE SECTION;
-  int iid = id, val, rowcount;
+  int iid = id, rowcount;
+  unsigned long long val;
+  char valstr[40] = {0}, *endptr = valstr+39;
   EXEC SQL END DECLARE SECTION;
 
   val = n->count;
   if (n->allocated != val)
     {
-      printf("Count wrong on NFSphys %s:%s; is %d in db, counted %d\n",
+      printf("Count wrong on NFSphys %s:%s; is %lld in db, counted %lld\n",
             ((struct machine *) hash_lookup(machines, n->mach_id))->name,
             n->dir, n->allocated, val);
       if (single_fix("Update", 1))
        {
-         EXEC SQL UPDATE nfsphys SET allocated = :val
+         strcpy(valstr, ulltostr(val, endptr));
+         EXEC SQL UPDATE nfsphys SET allocated = TO_NUMBER(:valstr)
            WHERE nfsphys_id = :iid;
          rowcount = sqlca.sqlerrd[2];
          if (rowcount > 0)
This page took 0.039117 seconds and 4 git commands to generate.