diff options
author | Konstantin Belousov <kib@FreeBSD.org> | 2017-01-06 16:59:33 +0000 |
---|---|---|
committer | Konstantin Belousov <kib@FreeBSD.org> | 2017-01-06 16:59:33 +0000 |
commit | 1c324569538099af34419e6818fbfde4779efd33 (patch) | |
tree | ebc1201ab230267c1270c833390c9a8b561d16ee /usr.sbin | |
parent | 6e89d383c70273e8c28b0f8a75ca3bd037ac4d5d (diff) | |
download | src-1c324569538099af34419e6818fbfde4779efd33.tar.gz src-1c324569538099af34419e6818fbfde4779efd33.zip |
Use type-independent formats for printing nlink_t and ino_t.
Extracted from: ino64 work by gleb, mckusick
Discussed with: mckusick
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Notes
Notes:
svn path=/head/; revision=311522
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/fmtree/compare.c | 5 | ||||
-rw-r--r-- | usr.sbin/fmtree/create.c | 3 | ||||
-rw-r--r-- | usr.sbin/fmtree/specspec.c | 2 |
3 files changed, 6 insertions, 4 deletions
diff --git a/usr.sbin/fmtree/compare.c b/usr.sbin/fmtree/compare.c index fdd37679c6ea..36d3f79d7090 100644 --- a/usr.sbin/fmtree/compare.c +++ b/usr.sbin/fmtree/compare.c @@ -165,8 +165,9 @@ typeerr: LABEL; if (s->flags & F_NLINK && s->type != F_DIR && s->st_nlink != p->fts_statp->st_nlink) { LABEL; - (void)printf("%slink_count expected %u found %u\n", - tab, s->st_nlink, p->fts_statp->st_nlink); + (void)printf("%slink_count expected %ju found %ju\n", + tab, (uintmax_t)s->st_nlink, + (uintmax_t)p->fts_statp->st_nlink); tab = "\t"; } if (s->flags & F_SIZE && s->st_size != p->fts_statp->st_size && diff --git a/usr.sbin/fmtree/create.c b/usr.sbin/fmtree/create.c index 8be9b02173ea..204f40abc15c 100644 --- a/usr.sbin/fmtree/create.c +++ b/usr.sbin/fmtree/create.c @@ -207,7 +207,8 @@ statf(int indent, FTSENT *p) if (keys & F_MODE && (p->fts_statp->st_mode & MBITS) != mode) output(indent, &offset, "mode=%#o", p->fts_statp->st_mode & MBITS); if (keys & F_NLINK && p->fts_statp->st_nlink != 1) - output(indent, &offset, "nlink=%u", p->fts_statp->st_nlink); + output(indent, &offset, "nlink=%ju", + (uintmax_t)p->fts_statp->st_nlink); if (keys & F_SIZE && S_ISREG(p->fts_statp->st_mode)) output(indent, &offset, "size=%jd", (intmax_t)p->fts_statp->st_size); diff --git a/usr.sbin/fmtree/specspec.c b/usr.sbin/fmtree/specspec.c index f85882e0deef..ac70c2831a69 100644 --- a/usr.sbin/fmtree/specspec.c +++ b/usr.sbin/fmtree/specspec.c @@ -64,7 +64,7 @@ shownode(NODE *n, int f, char const *path) if (f & F_MODE) printf(" mode=%o", n->st_mode); if (f & F_NLINK) - printf(" nlink=%d", n->st_nlink); + printf(" nlink=%ju", (uintmax_t)n->st_nlink); if (f & F_SIZE) printf(" size=%jd", (intmax_t)n->st_size); if (f & F_UID) |