diff options
Diffstat (limited to 'sbin/growfs')
-rw-r--r-- | sbin/growfs/debug.c | 5 | ||||
-rw-r--r-- | sbin/growfs/growfs.c | 9 |
2 files changed, 8 insertions, 6 deletions
diff --git a/sbin/growfs/debug.c b/sbin/growfs/debug.c index 3fe263f..5b62bdd 100644 --- a/sbin/growfs/debug.c +++ b/sbin/growfs/debug.c @@ -47,6 +47,7 @@ static const char rcsid[] = /* ********************************************************** INCLUDES ***** */ #include <sys/param.h> +#include <limits.h> #include <stdio.h> #include <ufs/ufs/dinode.h> #include <ufs/ffs/fs.h> @@ -456,7 +457,7 @@ dbg_dump_frmap(struct fs *sb, const char *comment, struct cg *cgr) indent++; cp=(unsigned char *)cg_blksfree(cgr); - e=howmany((sb->fs_cpg * sb->fs_spc / NSPF(sb)), NBBY); + e=howmany((sb->fs_cpg * sb->fs_spc / NSPF(sb)), CHAR_BIT); for(j=0; j<e; j+=32) { fprintf(dbg_log, "%08x: ", j); for(k=0; k<32; k+=8) { @@ -500,7 +501,7 @@ dbg_dump_clmap(struct fs *sb, const char *comment, struct cg *cgr) indent++; cp=(unsigned char *)cg_clustersfree(cgr); - e=howmany(sb->fs_cpg * sb->fs_spc / NSPB(sb), NBBY); + e=howmany(sb->fs_cpg * sb->fs_spc / NSPB(sb), CHAR_BIT); for(j=0; j<e; j+=32) { fprintf(dbg_log, "%08x: ", j); for(k=0; k<32; k+=8) { diff --git a/sbin/growfs/growfs.c b/sbin/growfs/growfs.c index 2db3430..368fa99 100644 --- a/sbin/growfs/growfs.c +++ b/sbin/growfs/growfs.c @@ -62,6 +62,7 @@ static const char rcsid[] = #include <ctype.h> #include <err.h> #include <fcntl.h> +#include <limits.h> #include <stdlib.h> #include <string.h> #include <unistd.h> @@ -410,8 +411,8 @@ initcg(int cylno, time_t utime, int fso, unsigned int Nflag) acg.cg_iusedoff = acg.cg_old_boff + sblock.fs_old_cpg * sizeof(u_int16_t); } - acg.cg_freeoff = acg.cg_iusedoff + howmany(sblock.fs_ipg, NBBY); - acg.cg_nextfreeoff = acg.cg_freeoff + howmany(sblock.fs_fpg, NBBY); + acg.cg_freeoff = acg.cg_iusedoff + howmany(sblock.fs_ipg, CHAR_BIT); + acg.cg_nextfreeoff = acg.cg_freeoff + howmany(sblock.fs_fpg, CHAR_BIT); if (sblock.fs_contigsumsize > 0) { acg.cg_clustersumoff = roundup(acg.cg_nextfreeoff, sizeof(u_int32_t)); @@ -419,7 +420,7 @@ initcg(int cylno, time_t utime, int fso, unsigned int Nflag) acg.cg_clusteroff = acg.cg_clustersumoff + (sblock.fs_contigsumsize + 1) * sizeof(u_int32_t); acg.cg_nextfreeoff = acg.cg_clusteroff + - howmany(fragstoblks(&sblock, sblock.fs_fpg), NBBY); + howmany(fragstoblks(&sblock, sblock.fs_fpg), CHAR_BIT); } if (acg.cg_nextfreeoff > sblock.fs_cgsize) { /* @@ -504,7 +505,7 @@ initcg(int cylno, time_t utime, int fso, unsigned int Nflag) sump[run]++; run = 0; } - if ((i & (NBBY - 1)) != NBBY - 1) + if ((i & (CHAR_BIT - 1)) != CHAR_BIT - 1) bit <<= 1; else { map = *mapp++; |