diff options
author | des <des@FreeBSD.org> | 2010-03-04 10:57:52 +0000 |
---|---|---|
committer | des <des@FreeBSD.org> | 2010-03-04 10:57:52 +0000 |
commit | 98b742f57cafbed05c101e60cc131f5980f044d0 (patch) | |
tree | 1cec7a6fc03fcfba4eaa4837869c9718bb1a8670 | |
parent | 995bf9b8d732152f75da1c3c6bb2bc749a297eda (diff) | |
download | FreeBSD-src-98b742f57cafbed05c101e60cc131f5980f044d0.zip FreeBSD-src-98b742f57cafbed05c101e60cc131f5980f044d0.tar.gz |
Fix warnings + indentation + utmpx
-rw-r--r-- | usr.sbin/repquota/repquota.c | 48 |
1 files changed, 25 insertions, 23 deletions
diff --git a/usr.sbin/repquota/repquota.c b/usr.sbin/repquota/repquota.c index aa822df..f90269f 100644 --- a/usr.sbin/repquota/repquota.c +++ b/usr.sbin/repquota/repquota.c @@ -49,7 +49,9 @@ __FBSDID("$FreeBSD$"); */ #include <sys/param.h> #include <sys/mount.h> + #include <ufs/ufs/quota.h> + #include <err.h> #include <errno.h> #include <fcntl.h> @@ -57,12 +59,12 @@ __FBSDID("$FreeBSD$"); #include <grp.h> #include <libutil.h> #include <pwd.h> +#include <stdint.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <time.h> #include <unistd.h> -#include <utmp.h> /* Let's be paranoid about block size */ #if 10 > DEV_BSHIFT @@ -218,9 +220,9 @@ repquota(struct fstab *fs, int type) fprintf(stdout, "*** Report for %s quotas on %s (%s)\n", qfextension[type], fs->fs_file, fs->fs_spec); printf("%*s Block limits File limits\n", - max(UT_NAMESIZE,10), " "); + max(MAXLOGNAME - 1, 10), " "); printf("User%*s used soft hard grace used soft hard grace\n", - max(UT_NAMESIZE,10), " "); + max(MAXLOGNAME - 1, 10), " "); maxid = quota_maxid(qf); for (id = 0; id < maxid; id++) { if (quota_read(qf, &dqbuf, id) != 0) @@ -229,30 +231,30 @@ repquota(struct fstab *fs, int type) continue; if ((fup = lookup(id, type)) == 0) fup = addid(id, type, (char *)0); - printf("%-*s ", max(UT_NAMESIZE,10), fup->fu_name); + printf("%-*s ", max(MAXLOGNAME - 1, 10), fup->fu_name); printf("%c%c", - dqbuf.dqb_bsoftlimit && - dqbuf.dqb_curblocks >= - dqbuf.dqb_bsoftlimit ? '+' : '-', - dqbuf.dqb_isoftlimit && - dqbuf.dqb_curinodes >= - dqbuf.dqb_isoftlimit ? '+' : '-'); + dqbuf.dqb_bsoftlimit && + dqbuf.dqb_curblocks >= + dqbuf.dqb_bsoftlimit ? '+' : '-', + dqbuf.dqb_isoftlimit && + dqbuf.dqb_curinodes >= + dqbuf.dqb_isoftlimit ? '+' : '-'); prthumanval(dqbuf.dqb_curblocks); prthumanval(dqbuf.dqb_bsoftlimit); prthumanval(dqbuf.dqb_bhardlimit); printf(" %6s", - dqbuf.dqb_bsoftlimit && - dqbuf.dqb_curblocks >= - dqbuf.dqb_bsoftlimit ? - timeprt(dqbuf.dqb_btime) : "-"); - printf(" %7llu %7llu %7llu %6s\n", - dqbuf.dqb_curinodes, - dqbuf.dqb_isoftlimit, - dqbuf.dqb_ihardlimit, - dqbuf.dqb_isoftlimit && - dqbuf.dqb_curinodes >= - dqbuf.dqb_isoftlimit ? - timeprt(dqbuf.dqb_itime) : "-"); + dqbuf.dqb_bsoftlimit && + dqbuf.dqb_curblocks >= + dqbuf.dqb_bsoftlimit ? + timeprt(dqbuf.dqb_btime) : "-"); + printf(" %7ju %7ju %7ju %6s\n", + (uintmax_t)dqbuf.dqb_curinodes, + (uintmax_t)dqbuf.dqb_isoftlimit, + (uintmax_t)dqbuf.dqb_ihardlimit, + dqbuf.dqb_isoftlimit && + dqbuf.dqb_curinodes >= + dqbuf.dqb_isoftlimit ? + timeprt(dqbuf.dqb_itime) : "-"); } quota_close(qf); return (0); @@ -265,7 +267,7 @@ prthumanval(int64_t blocks) int flags; if (!hflag) { - printf(" %6llu", dbtokb(blocks)); + printf(" %6ju", (uintmax_t)dbtokb(blocks)); return; } flags = HN_NOSPACE | HN_DECIMAL; |