diff options
author | cinap_lenrek <cinap_lenrek@localhost> | 2011-04-18 06:35:33 +0000 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@localhost> | 2011-04-18 06:35:33 +0000 |
commit | ad5522be0fbfcad7b47bb9baca9a44dadb4b6461 (patch) | |
tree | 4e5622e0b5d1d0037406ac345d2a91e2c11e1bfc /sys/src/cmd/fossil/epoch.c | |
parent | a455c61024cab80bfc50c898d8686068cd8ea06a (diff) |
remove fossil
Diffstat (limited to 'sys/src/cmd/fossil/epoch.c')
-rw-r--r-- | sys/src/cmd/fossil/epoch.c | 51 |
1 files changed, 0 insertions, 51 deletions
diff --git a/sys/src/cmd/fossil/epoch.c b/sys/src/cmd/fossil/epoch.c deleted file mode 100644 index 6aa73bbf1..000000000 --- a/sys/src/cmd/fossil/epoch.c +++ /dev/null @@ -1,51 +0,0 @@ -#include "stdinc.h" -#include "dat.h" -#include "fns.h" - -uchar buf[65536]; - -void -usage(void) -{ - fprint(2, "usage: fossil/epoch fs [new-low-epoch]\n"); - exits("usage"); -} - -void -main(int argc, char **argv) -{ - int fd; - Header h; - Super s; - - ARGBEGIN{ - default: - usage(); - }ARGEND - - if(argc == 0 || argc > 2) - usage(); - - if((fd = open(argv[0], argc==2 ? ORDWR : OREAD)) < 0) - sysfatal("open %s: %r", argv[0]); - - if(pread(fd, buf, HeaderSize, HeaderOffset) != HeaderSize) - sysfatal("reading header: %r"); - if(!headerUnpack(&h, buf)) - sysfatal("unpacking header: %r"); - - if(pread(fd, buf, h.blockSize, (vlong)h.super*h.blockSize) != h.blockSize) - sysfatal("reading super block: %r"); - - if(!superUnpack(&s, buf)) - sysfatal("unpacking super block: %r"); - - print("epoch %d\n", s.epochLow); - if(argc == 2){ - s.epochLow = strtoul(argv[1], 0, 0); - superPack(&s, buf); - if(pwrite(fd, buf, h.blockSize, (vlong)h.super*h.blockSize) != h.blockSize) - sysfatal("writing super block: %r"); - } - exits(0); -} |