diff options
-rw-r--r-- | sbin/fsdb/Makefile | 1 | ||||
-rw-r--r-- | sbin/fsdb/fsdb.c | 1 | ||||
-rw-r--r-- | sbin/fsdb/fsdbutil.c | 16 |
3 files changed, 10 insertions, 8 deletions
diff --git a/sbin/fsdb/Makefile b/sbin/fsdb/Makefile index d12f7e6f2ee9..5e1591b22ce9 100644 --- a/sbin/fsdb/Makefile +++ b/sbin/fsdb/Makefile @@ -8,7 +8,6 @@ SRCS= fsdb.c fsdbutil.c \ dir.c ea.c fsutil.c inode.c pass1.c pass1b.c pass2.c pass3.c pass4.c \ pass5.c setup.c utilities.c ffs_subr.c ffs_tables.c CFLAGS+= -I${.CURDIR}/../fsck_ffs -WARNS= 0 LDADD+= -ledit -ltermcap DPADD+= ${LIBEDIT} ${LIBTERMCAP} .PATH: ${.CURDIR}/../fsck_ffs ${.CURDIR}/../../sys/ufs/ffs diff --git a/sbin/fsdb/fsdb.c b/sbin/fsdb/fsdb.c index 1e91d22fca4d..f60f50c9852c 100644 --- a/sbin/fsdb/fsdb.c +++ b/sbin/fsdb/fsdb.c @@ -41,6 +41,7 @@ static const char rcsid[] = #include <histedit.h> #include <pwd.h> #include <string.h> +#include <timeconv.h> #include <ufs/ufs/dinode.h> #include <ufs/ufs/dir.h> diff --git a/sbin/fsdb/fsdbutil.c b/sbin/fsdb/fsdbutil.c index b0d4c1244829..b00061941e00 100644 --- a/sbin/fsdb/fsdbutil.c +++ b/sbin/fsdb/fsdbutil.c @@ -38,8 +38,10 @@ static const char rcsid[] = #include <err.h> #include <grp.h> #include <pwd.h> +#include <stdint.h> #include <string.h> #include <time.h> +#include <timeconv.h> #include <ufs/ufs/dinode.h> #include <ufs/ffs/fs.h> @@ -152,8 +154,8 @@ printstat(const char *cp, ino_t inum, union dinode *dp) puts("fifo"); break; } - printf("I=%lu MODE=%o SIZE=%qu", (u_long)inum, DIP(dp, di_mode), - DIP(dp, di_size)); + printf("I=%lu MODE=%o SIZE=%ju", (u_long)inum, DIP(dp, di_mode), + (uintmax_t)DIP(dp, di_size)); if (sblock.fs_magic == FS_UFS1_MAGIC) t = _time32_to_time(dp->dp1.di_mtime); else @@ -187,8 +189,8 @@ printstat(const char *cp, ino_t inum, union dinode *dp) blocks = DIP(dp, di_blocks); gen = DIP(dp, di_gen); - printf("LINKCNT=%hd FLAGS=%#x BLKCNT=%qx GEN=%qx\n", DIP(dp, di_nlink), - DIP(dp, di_flags), blocks, gen); + printf("LINKCNT=%hd FLAGS=%#x BLKCNT=%jx GEN=%jx\n", DIP(dp, di_nlink), + DIP(dp, di_flags), (intmax_t)blocks, (intmax_t)gen); } @@ -248,7 +250,7 @@ printindir(ufs2_daddr_t blk, int level, char *bufp) putchar('\n'); return 0; } - j = sprintf(tempbuf, "%qd", blkno); + j = sprintf(tempbuf, "%jd", (intmax_t)blkno); if (level == 0) { charssofar += j; if (charssofar >= cpl - 2) { @@ -279,7 +281,7 @@ static void printblocks(ino_t inum, union dinode *dp) { char *bufp; - int i, j, nfrags; + int i, nfrags; long ndb, offset; ufs2_daddr_t blkno; @@ -294,7 +296,7 @@ printblocks(ino_t inum, union dinode *dp) if (i > 0) printf(", "); blkno = DIP(dp, di_db[i]); - printf("%qd", blkno); + printf("%jd", (intmax_t)blkno); if (--ndb == 0 && (offset = blkoff(&sblock, DIP(dp, di_size))) != 0) { nfrags = numfrags(&sblock, fragroundup(&sblock, offset)); printf(" (%d frag%s)", nfrags, nfrags > 1? "s": ""); |