summaryrefslogtreecommitdiffstats
path: root/sbin
diff options
context:
space:
mode:
authorbde <bde@FreeBSD.org>2002-07-11 17:49:41 +0000
committerbde <bde@FreeBSD.org>2002-07-11 17:49:41 +0000
commit9180aabc4ca6e999cde1883d5f2fa501c953cd36 (patch)
tree1087475304b27d4fbf55321cbe2bd410e4760a0f /sbin
parent8677b9941078cccf6c63cf5f21b31bf8192df4f4 (diff)
downloadFreeBSD-src-9180aabc4ca6e999cde1883d5f2fa501c953cd36.zip
FreeBSD-src-9180aabc4ca6e999cde1883d5f2fa501c953cd36.tar.gz
Fixed 4 printf format errors that were fatal on alphas. %qd is not even
suitable for printing quad_t's since it is equivalent to %lld but quad_t is unsigned long on alphas. quad_t shouldn't be used anyway.
Diffstat (limited to 'sbin')
-rw-r--r--sbin/newfs/mkfs.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/sbin/newfs/mkfs.c b/sbin/newfs/mkfs.c
index 98ae34a..6c0283d 100644
--- a/sbin/newfs/mkfs.c
+++ b/sbin/newfs/mkfs.c
@@ -55,6 +55,7 @@ static const char rcsid[] =
#include <signal.h>
#include <stdlib.h>
#include <string.h>
+#include <stdint.h>
#include <stdio.h>
#include <unistd.h>
#include <sys/param.h>
@@ -156,7 +157,7 @@ mkfs(struct partition *pp, char *fsys)
* Convert to filesystem fragment sized units.
*/
if (fssize <= 0) {
- printf("preposterous size %qd\n", fssize);
+ printf("preposterous size %jd\n", (intmax_t)fssize);
exit(13);
}
wtfs(fssize - (realsectorsize / DEV_BSIZE), realsectorsize,
@@ -348,8 +349,8 @@ mkfs(struct partition *pp, char *fsys)
lastminfpg = roundup(sblock.fs_iblkno +
sblock.fs_ipg / INOPF(&sblock), sblock.fs_frag);
if (sblock.fs_size < lastminfpg) {
- printf("Filesystem size %qd < minimum size of %d\n",
- sblock.fs_size, lastminfpg);
+ printf("Filesystem size %jd < minimum size of %d\n",
+ (intmax_t)sblock.fs_size, lastminfpg);
exit(28);
}
if (sblock.fs_size % sblock.fs_fpg >= lastminfpg ||
@@ -420,9 +421,10 @@ mkfs(struct partition *pp, char *fsys)
* Dump out summary information about filesystem.
*/
# define B2MBFACTOR (1 / (1024.0 * 1024.0))
- printf("%s: %.1fMB (%qd sectors) block size %d, fragment size %d\n",
+ printf("%s: %.1fMB (%jd sectors) block size %d, fragment size %d\n",
fsys, (float)sblock.fs_size * sblock.fs_fsize * B2MBFACTOR,
- fsbtodb(&sblock, sblock.fs_size), sblock.fs_bsize, sblock.fs_fsize);
+ (intmax_t)fsbtodb(&sblock, sblock.fs_size), sblock.fs_bsize,
+ sblock.fs_fsize);
printf("\tusing %d cylinder groups of %.2fMB, %d blks, %d inodes.\n",
sblock.fs_ncg, (float)sblock.fs_fpg * sblock.fs_fsize * B2MBFACTOR,
sblock.fs_fpg / sblock.fs_frag, sblock.fs_ipg);
@@ -443,8 +445,8 @@ mkfs(struct partition *pp, char *fsys)
bcopy((char *)&sblock, iobuf, SBLOCKSIZE);
for (cylno = 0; cylno < sblock.fs_ncg; cylno++) {
initcg(cylno, utime);
- j = snprintf(tmpbuf, sizeof(tmpbuf), " %qd%s",
- fsbtodb(&sblock, cgsblock(&sblock, cylno)),
+ j = snprintf(tmpbuf, sizeof(tmpbuf), " %jd%s",
+ (intmax_t)fsbtodb(&sblock, cgsblock(&sblock, cylno)),
cylno < (sblock.fs_ncg-1) ? "," : "");
if (j < 0)
tmpbuf[j = 0] = '\0';
OpenPOWER on IntegriCloud