Don't depend on <utmp.h>.

MAXLOGNAME seems more applicable in this case, because UT_NAMESIZE
refers to the username field in utmp files, which is clearly unrelated
to repquota(8).
This commit is contained in:
Ed Schouten 2009-12-06 01:29:49 +00:00
parent 41d6f23028
commit f449291b33
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=200174

View file

@ -60,7 +60,6 @@ __FBSDID("$FreeBSD$");
#include <string.h>
#include <time.h>
#include <unistd.h>
#include <utmp.h>
/* Let's be paranoid about block size */
#if 10 > DEV_BSHIFT
@ -227,9 +226,9 @@ repquota(struct fstab *fs, int type, char *qfpathname)
}
fclose(qf);
printf("%*s Block limits File limits\n",
max(UT_NAMESIZE,10), " ");
max(MAXLOGNAME-1,10), " ");
printf("%s%*s used soft hard grace used soft hard grace\n",
type == USRQUOTA ? "User " : "Group", max(UT_NAMESIZE,10), " ");
type == USRQUOTA ? "User " : "Group", max(MAXLOGNAME-1,10), " ");
for (id = 0; id <= highid[type]; id++) {
fup = lookup(id, type);
if (fup == 0)
@ -237,7 +236,7 @@ repquota(struct fstab *fs, int type, char *qfpathname)
if (fup->fu_dqblk.dqb_curinodes == 0 &&
fup->fu_dqblk.dqb_curblocks == 0)
continue;
printf("%-*s ", max(UT_NAMESIZE,10), fup->fu_name);
printf("%-*s ", max(MAXLOGNAME-1,10), fup->fu_name);
printf("%c%c %8lu %8lu %8lu %6s",
fup->fu_dqblk.dqb_bsoftlimit &&
fup->fu_dqblk.dqb_curblocks >=