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 /contrib | |
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 'contrib')
-rw-r--r-- | contrib/mtree/create.c | 3 | ||||
-rw-r--r-- | contrib/mtree/spec.c | 3 | ||||
-rw-r--r-- | contrib/mtree/specspec.c | 2 |
3 files changed, 5 insertions, 3 deletions
diff --git a/contrib/mtree/create.c b/contrib/mtree/create.c index 8601cfa5378a..eb7bce180d60 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 0fb921d1c0ed..6fbe6f534560 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 2821fd1d8bea..466cb60bb32c 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) |