summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormdf <mdf@FreeBSD.org>2012-09-27 23:31:19 +0000
committermdf <mdf@FreeBSD.org>2012-09-27 23:31:19 +0000
commita782f0b8bd315c02033a4fb363e550bd467101c7 (patch)
tree8a4bdcc7b13b351076583f8136d9f3cd310718b6
parent8ce8b3ae17aae9323001285d2530d9b793f3c36d (diff)
downloadFreeBSD-src-a782f0b8bd315c02033a4fb363e550bd467101c7.zip
FreeBSD-src-a782f0b8bd315c02033a4fb363e550bd467101c7.tar.gz
Fix usr.bin/ and usr.sbin/ build with a 64-bit ino_t.
Original code by: Gleb Kurtsou
-rw-r--r--usr.bin/find/ls.c2
-rw-r--r--usr.sbin/lpr/lpr/lpr.c5
-rw-r--r--usr.sbin/makefs/ffs/ffs_alloc.c5
-rw-r--r--usr.sbin/quot/quot.c6
-rw-r--r--usr.sbin/snapinfo/snapinfo.c3
5 files changed, 12 insertions, 9 deletions
diff --git a/usr.bin/find/ls.c b/usr.bin/find/ls.c
index 44d1852..082fd64 100644
--- a/usr.bin/find/ls.c
+++ b/usr.bin/find/ls.c
@@ -63,7 +63,7 @@ printlong(char *name, char *accpath, struct stat *sb)
{
char modep[15];
- (void)printf("%6lu %8"PRId64" ", (u_long) sb->st_ino, sb->st_blocks);
+ (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,
user_from_uid(sb->st_uid, 0), MAXLOGNAME - 1,
diff --git a/usr.sbin/lpr/lpr/lpr.c b/usr.sbin/lpr/lpr/lpr.c
index 9ae72f6..af7c807 100644
--- a/usr.sbin/lpr/lpr/lpr.c
+++ b/usr.sbin/lpr/lpr/lpr.c
@@ -75,6 +75,7 @@ __FBSDID("$FreeBSD$");
#include <grp.h>
#include <unistd.h>
#include <stdlib.h>
+#include <stdint.h>
#include <stdio.h>
#include <ctype.h>
#include <string.h>
@@ -386,8 +387,8 @@ main(int argc, char *argv[])
continue; /* file unreasonable */
if (sflag && (cp = linked(arg)) != NULL) {
- (void) snprintf(buf, sizeof(buf), "%u %u", statb.st_dev,
- statb.st_ino);
+ (void)snprintf(buf, sizeof(buf), "%u %ju",
+ statb.st_dev, (uintmax_t)statb.st_ino);
card('S', buf);
if (format == 'p')
card('T', title ? title : arg);
diff --git a/usr.sbin/makefs/ffs/ffs_alloc.c b/usr.sbin/makefs/ffs/ffs_alloc.c
index f676a39..afab869 100644
--- a/usr.sbin/makefs/ffs/ffs_alloc.c
+++ b/usr.sbin/makefs/ffs/ffs_alloc.c
@@ -48,6 +48,7 @@ __FBSDID("$FreeBSD$");
#include <sys/time.h>
#include <errno.h>
+#include <stdint.h>
#include "makefs.h"
@@ -439,8 +440,8 @@ ffs_blkfree(struct inode *ip, daddr_t bno, long size)
}
cg = dtog(fs, bno);
if (bno >= fs->fs_size) {
- warnx("bad block %lld, ino %llu", (long long)bno,
- (unsigned long long)ip->i_number);
+ warnx("bad block %lld, ino %ju", (long long)bno,
+ (uintmax_t)ip->i_number);
return;
}
error = bread(ip->i_fd, ip->i_fs, fsbtodb(fs, cgtod(fs, cg)),
diff --git a/usr.sbin/quot/quot.c b/usr.sbin/quot/quot.c
index 979eef4..ac90da6 100644
--- a/usr.sbin/quot/quot.c
+++ b/usr.sbin/quot/quot.c
@@ -484,8 +484,8 @@ static void
donames(int fd, struct fs *super, char *name)
{
int c;
- ino_t inode;
ino_t maxino;
+ uintmax_t inode;
union dinode *dp;
maxino = super->fs_ncg * super->fs_ipg - 1;
@@ -493,9 +493,9 @@ donames(int fd, struct fs *super, char *name)
while ((c = getchar()) != EOF && (c < '0' || c > '9'))
while ((c = getchar()) != EOF && c != '\n');
ungetc(c,stdin);
- while (scanf("%u",&inode) == 1) {
+ while (scanf("%ju", &inode) == 1) {
if (inode > maxino) {
- warnx("illegal inode %d",inode);
+ warnx("illegal inode %ju", inode);
return;
}
errno = 0;
diff --git a/usr.sbin/snapinfo/snapinfo.c b/usr.sbin/snapinfo/snapinfo.c
index 45882e0..23c3b4b 100644
--- a/usr.sbin/snapinfo/snapinfo.c
+++ b/usr.sbin/snapinfo/snapinfo.c
@@ -34,6 +34,7 @@
#include <errno.h>
#include <ftw.h>
#include <libufs.h>
+#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -149,7 +150,7 @@ compare_function(const char *path, const struct stat *st, int flags,
printf("\tsnapshot ");
printf("%s", path);
if (verbose)
- printf(" (inode %d)", st->st_ino);
+ printf(" (inode %ju)", (uintmax_t)st->st_ino);
printf("\n");
if (!cont_search)
return (EEXIST);
OpenPOWER on IntegriCloud