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.bin | |
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.bin')
-rw-r--r-- | usr.bin/find/ls.c | 3 | ||||
-rw-r--r-- | usr.bin/gzip/gzip.c | 8 |
2 files changed, 6 insertions, 5 deletions
diff --git a/usr.bin/find/ls.c b/usr.bin/find/ls.c index 082fd6411845..953c45657ca4 100644 --- a/usr.bin/find/ls.c +++ b/usr.bin/find/ls.c @@ -65,7 +65,8 @@ printlong(char *name, char *accpath, struct stat *sb) (void)printf("%6ju %8"PRId64" ", (uintmax_t)sb->st_ino, sb->st_blocks); (void)strmode(sb->st_mode, modep); - (void)printf("%s %3u %-*s %-*s ", modep, sb->st_nlink, MAXLOGNAME - 1, + (void)printf("%s %3ju %-*s %-*s ", modep, (uintmax_t)sb->st_nlink, + MAXLOGNAME - 1, user_from_uid(sb->st_uid, 0), MAXLOGNAME - 1, group_from_gid(sb->st_gid, 0)); diff --git a/usr.bin/gzip/gzip.c b/usr.bin/gzip/gzip.c index 6561c9c4d629..63bde3ad3a90 100644 --- a/usr.bin/gzip/gzip.c +++ b/usr.bin/gzip/gzip.c @@ -1252,8 +1252,8 @@ file_compress(char *file, char *outfile, size_t outsize) if (cflag == 0) { #ifndef SMALL if (isb.st_nlink > 1 && fflag == 0) { - maybe_warnx("%s has %d other link%s -- skipping", - file, isb.st_nlink - 1, + maybe_warnx("%s has %ju other link%s -- skipping", + file, (uintmax_t)isb.st_nlink - 1, (isb.st_nlink - 1) == 1 ? "" : "s"); close(in); return (-1); @@ -1448,8 +1448,8 @@ file_uncompress(char *file, char *outfile, size_t outsize) goto lose; #ifndef SMALL if (isb.st_nlink > 1 && lflag == 0 && fflag == 0) { - maybe_warnx("%s has %d other links -- skipping", - file, isb.st_nlink - 1); + maybe_warnx("%s has %ju other links -- skipping", + file, (uintmax_t)isb.st_nlink - 1); goto lose; } if (nflag == 0 && timestamp) |