Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 27 Sep 2012 23:31:19 +0000 (UTC)
From:      Matthew D Fleming <mdf@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r241015 - in head: usr.bin/find usr.sbin/lpr/lpr usr.sbin/makefs/ffs usr.sbin/quot usr.sbin/snapinfo
Message-ID:  <201209272331.q8RNVJfA024060@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mdf
Date: Thu Sep 27 23:31:19 2012
New Revision: 241015
URL: http://svn.freebsd.org/changeset/base/241015

Log:
  Fix usr.bin/ and usr.sbin/ build with a 64-bit ino_t.
  
  Original code by:	Gleb Kurtsou

Modified:
  head/usr.bin/find/ls.c
  head/usr.sbin/lpr/lpr/lpr.c
  head/usr.sbin/makefs/ffs/ffs_alloc.c
  head/usr.sbin/quot/quot.c
  head/usr.sbin/snapinfo/snapinfo.c

Modified: head/usr.bin/find/ls.c
==============================================================================
--- head/usr.bin/find/ls.c	Thu Sep 27 23:31:12 2012	(r241014)
+++ head/usr.bin/find/ls.c	Thu Sep 27 23:31:19 2012	(r241015)
@@ -63,7 +63,7 @@ printlong(char *name, char *accpath, str
 {
 	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,

Modified: head/usr.sbin/lpr/lpr/lpr.c
==============================================================================
--- head/usr.sbin/lpr/lpr/lpr.c	Thu Sep 27 23:31:12 2012	(r241014)
+++ head/usr.sbin/lpr/lpr/lpr.c	Thu Sep 27 23:31:19 2012	(r241015)
@@ -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);

Modified: head/usr.sbin/makefs/ffs/ffs_alloc.c
==============================================================================
--- head/usr.sbin/makefs/ffs/ffs_alloc.c	Thu Sep 27 23:31:12 2012	(r241014)
+++ head/usr.sbin/makefs/ffs/ffs_alloc.c	Thu Sep 27 23:31:19 2012	(r241015)
@@ -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 bn
 	}
 	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)),

Modified: head/usr.sbin/quot/quot.c
==============================================================================
--- head/usr.sbin/quot/quot.c	Thu Sep 27 23:31:12 2012	(r241014)
+++ head/usr.sbin/quot/quot.c	Thu Sep 27 23:31:19 2012	(r241015)
@@ -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 *
 	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;

Modified: head/usr.sbin/snapinfo/snapinfo.c
==============================================================================
--- head/usr.sbin/snapinfo/snapinfo.c	Thu Sep 27 23:31:12 2012	(r241014)
+++ head/usr.sbin/snapinfo/snapinfo.c	Thu Sep 27 23:31:19 2012	(r241015)
@@ -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
 			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);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201209272331.q8RNVJfA024060>