summaryrefslogtreecommitdiffstats
path: root/contrib/mtree
diff options
context:
space:
mode:
authorkib <kib@FreeBSD.org>2017-01-13 13:37:09 +0000
committerkib <kib@FreeBSD.org>2017-01-13 13:37:09 +0000
commita0454e7cff5b13632ab8c24479efd1074f2f8767 (patch)
treea513a4560fc50c02cb44f7a79c5b3aa4d0570725 /contrib/mtree
parent2eaa0f81174966046fba99f19c1f0563fe8ccd78 (diff)
downloadFreeBSD-src-a0454e7cff5b13632ab8c24479efd1074f2f8767.zip
FreeBSD-src-a0454e7cff5b13632ab8c24479efd1074f2f8767.tar.gz
MFC r311522:
Use type-independent formats for printing nlink_t and ino_t.
Diffstat (limited to 'contrib/mtree')
-rw-r--r--contrib/mtree/create.c3
-rw-r--r--contrib/mtree/spec.c3
-rw-r--r--contrib/mtree/specspec.c2
3 files changed, 5 insertions, 3 deletions
diff --git a/contrib/mtree/create.c b/contrib/mtree/create.c
index 8601cfa..eb7bce1 100644
--- a/contrib/mtree/create.c
+++ b/contrib/mtree/create.c
@@ -224,7 +224,8 @@ statf(FILE *fp, int indent, FTSENT *p)
output(fp, indent, &offset, "device=%#jx",
(uintmax_t)p->fts_statp->st_rdev);
if (keys & F_NLINK && p->fts_statp->st_nlink != 1)
- output(fp, indent, &offset, "nlink=%u", p->fts_statp->st_nlink);
+ output(fp, indent, &offset, "nlink=%ju",
+ (uintmax_t)p->fts_statp->st_nlink);
if (keys & F_SIZE &&
(flavor == F_FREEBSD9 || S_ISREG(p->fts_statp->st_mode)))
output(fp, indent, &offset, "size=%ju",
diff --git a/contrib/mtree/spec.c b/contrib/mtree/spec.c
index 0fb921d..6fbe6f5 100644
--- a/contrib/mtree/spec.c
+++ b/contrib/mtree/spec.c
@@ -363,7 +363,8 @@ dump_nodes(FILE *fp, const char *dir, NODE *root, int pathlast)
appendfield(fp, pathlast, "device=%#jx",
(uintmax_t)cur->st_rdev);
if (MATCHFLAG(F_NLINK))
- appendfield(fp, pathlast, "nlink=%d", cur->st_nlink);
+ appendfield(fp, pathlast, "nlink=%ju",
+ (uintmax_t)cur->st_nlink);
if (MATCHFLAG(F_SLINK))
appendfield(fp, pathlast, "link=%s",
vispath(cur->slink));
diff --git a/contrib/mtree/specspec.c b/contrib/mtree/specspec.c
index 2821fd1..466cb60 100644
--- a/contrib/mtree/specspec.c
+++ b/contrib/mtree/specspec.c
@@ -73,7 +73,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)
OpenPOWER on IntegriCloud