]> andersk Git - moira.git/commitdiff
when writing to a prdb if the ubik version is 0.0, set it to 2.0
authorjweiss <jweiss>
Sun, 7 Nov 1999 12:30:17 +0000 (12:30 +0000)
committerjweiss <jweiss>
Sun, 7 Nov 1999 12:30:17 +0000 (12:30 +0000)
since values of 0 and 1 for the epoch have special meanings.

afssync/pt_util.c

index 85f124ef424eedbe6cdb0f99cb45f574ff5dcd67..d661525b47e84ac69ac6762ee5ac457009d5dbb7 100644 (file)
@@ -169,6 +169,16 @@ char **argv;
        fprintf(stderr, "ptdump: %s: Bad UBIK_MAGIC. Is %x should be %x\n",
                pfile, ntohl(uh->magic), UBIK_MAGIC);
     memcpy(&uv, &uh->version, sizeof(struct ubik_version));
+    if (wflag && uv.epoch==0 && uv.counter==0) {
+       uv.epoch=2; /* a ubik version of 0 or 1 has special meaning */
+       memcpy(&uh->version, &uv, sizeof(struct ubik_version));
+       lseek(dbase_fd, 0, SEEK_SET);
+       if (write(dbase_fd, buffer, HDRSIZE) < 0) {
+           fprintf(stderr, "ptdump: error writing ubik version to %s: %s\n",
+                   pfile, sys_errlist[errno]);
+           exit (1);
+       }
+    }
     fprintf(stderr, "Ubik Version is: %d.%d\n",
            uv.epoch, uv.counter);
     if (read(dbase_fd, &prh, sizeof(struct prheader)) < 0) {
This page took 0.03144 seconds and 5 git commands to generate.