diff options
author | mdf <mdf@FreeBSD.org> | 2012-09-27 23:31:06 +0000 |
---|---|---|
committer | mdf <mdf@FreeBSD.org> | 2012-09-27 23:31:06 +0000 |
commit | e76336791156e518c57a0aa274e1652774931971 (patch) | |
tree | 51028e29caefe265e99cac58ecb1cce380def92e /sbin/restore/restore.c | |
parent | 908993ebfad03e82e8f3038681a0041f4766098e (diff) | |
download | FreeBSD-src-e76336791156e518c57a0aa274e1652774931971.zip FreeBSD-src-e76336791156e518c57a0aa274e1652774931971.tar.gz |
Fix sbin/ build with a 64-bit ino_t.
Original code by: Gleb Kurtsou
Diffstat (limited to 'sbin/restore/restore.c')
-rw-r--r-- | sbin/restore/restore.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/sbin/restore/restore.c b/sbin/restore/restore.c index e494cdb..fbc24ec 100644 --- a/sbin/restore/restore.c +++ b/sbin/restore/restore.c @@ -39,6 +39,7 @@ __FBSDID("$FreeBSD$"); #include <sys/types.h> #include <limits.h> +#include <stdint.h> #include <stdio.h> #include <string.h> @@ -61,7 +62,7 @@ listfile(char *name, ino_t ino, int type) if (TSTINO(ino, dumpmap) == 0) return (descend); vprintf(stdout, "%s", type == LEAF ? "leaf" : "dir "); - fprintf(stdout, "%10d\t%s\n", ino, name); + fprintf(stdout, "%10ju\t%s\n", (uintmax_t)ino, name); return (descend); } @@ -83,7 +84,7 @@ addfile(char *name, ino_t ino, int type) if (ino == WINO && command == 'i' && !vflag) return (descend); if (!mflag) { - (void) sprintf(buf, "./%u", ino); + (void) sprintf(buf, "./%ju", (uintmax_t)ino); name = buf; if (type == NODE) { (void) genliteraldir(name, ino); @@ -457,8 +458,8 @@ nodeupdates(char *name, ino_t ino, int type) * next incremental tape. */ case 0: - fprintf(stderr, "%s: (inode %d) not found on tape\n", - name, ino); + fprintf(stderr, "%s: (inode %ju) not found on tape\n", + name, (uintmax_t)ino); break; /* @@ -612,7 +613,7 @@ createleaves(char *symtabfile) while (first < curfile.ino) { ep = lookupino(first); if (ep == NULL) - panic("%d: bad first\n", first); + panic("%ju: bad first\n", (uintmax_t)first); fprintf(stderr, "%s: not found on tape\n", myname(ep)); ep->e_flags &= ~(NEW|EXTRACT); first = lowerbnd(first); @@ -625,8 +626,8 @@ createleaves(char *symtabfile) * on the next incremental tape. */ if (first != curfile.ino) { - fprintf(stderr, "expected next file %d, got %d\n", - first, curfile.ino); + fprintf(stderr, "expected next file %ju, got %ju\n", + (uintmax_t)first, (uintmax_t)curfile.ino); skipfile(); goto next; } @@ -852,7 +853,7 @@ verifyfile(char *name, ino_t ino, int type) if (np == ep) break; if (np == NULL) - panic("missing inumber %d\n", ino); + panic("missing inumber %ju\n", (uintmax_t)ino); if (ep->e_type == LEAF && type != LEAF) badentry(ep, "type should be LEAF"); return (descend); |