diff options
author | angelos <angelos@openbsd.org> | 2001-01-14 23:03:05 +0000 |
---|---|---|
committer | angelos <angelos@openbsd.org> | 2001-01-14 23:03:05 +0000 |
commit | 717081f3a0758d64df8128003d12dd29c0423b0e (patch) | |
tree | efa372cb8aa78610074c6c68198cce9abfa819be /usr.sbin/edquota | |
parent | Compute UDP checksum, PR 1621 (matthieu.herrb@wanadoo.fr) (diff) | |
download | wireguard-openbsd-717081f3a0758d64df8128003d12dd29c0423b0e.tar.xz wireguard-openbsd-717081f3a0758d64df8128003d12dd29c0423b0e.zip |
Handle quotas over 4G, PR 1534 (bob@prophecy.lu)
Diffstat (limited to 'usr.sbin/edquota')
-rw-r--r-- | usr.sbin/edquota/edquota.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/usr.sbin/edquota/edquota.c b/usr.sbin/edquota/edquota.c index 2454e60e127..aed80aecd8f 100644 --- a/usr.sbin/edquota/edquota.c +++ b/usr.sbin/edquota/edquota.c @@ -42,7 +42,7 @@ static char copyright[] = #ifndef lint /*static char sccsid[] = "from: @(#)edquota.c 8.1 (Berkeley) 6/6/93";*/ -static char *rcsid = "$Id: edquota.c,v 1.25 2000/12/21 09:48:05 pjanzen Exp $"; +static char *rcsid = "$Id: edquota.c,v 1.26 2001/01/14 23:03:39 angelos Exp $"; #endif /* not lint */ /* @@ -66,6 +66,12 @@ static char *rcsid = "$Id: edquota.c,v 1.25 2000/12/21 09:48:05 pjanzen Exp $"; #include <unistd.h> #include "pathnames.h" +#if DEV_BSHIFT < 10 +#define dbtokb(x) ((x) >> (10 - DEV_BSHIFT)) +#else +#define dbtokb(x) ((x) << (DEV_BSHIFT - 10)) +#endif + char *qfname = QUOTAFILENAME; char *qfextension[] = INITQFNAMES; char *quotagroup = QUOTAGROUP; @@ -431,12 +437,12 @@ writeprivs(quplist, outfd, name, quotatype) err(1, "%s", tmpfil); (void)fprintf(fd, "Quotas for %s %s:\n", qfextension[quotatype], name); for (qup = quplist; qup; qup = qup->next) { - (void)fprintf(fd, "%s: %s %d, limits (soft = %d, hard = %d)\n", + (void)fprintf(fd, "%s: %s %lu, limits (soft = %lu, hard = %lu)\n", qup->fsname, "blocks in use:", - (int)(dbtob((u_quad_t)qup->dqblk.dqb_curblocks) / 1024), - (int)(dbtob((u_quad_t)qup->dqblk.dqb_bsoftlimit) / 1024), - (int)(dbtob((u_quad_t)qup->dqblk.dqb_bhardlimit) / 1024)); - (void)fprintf(fd, "%s %d, limits (soft = %d, hard = %d)\n", + (int)(dbtokb((u_quad_t)qup->dqblk.dqb_curblocks)), + (int)(dbtokb((u_quad_t)qup->dqblk.dqb_bsoftlimit)), + (int)(dbtokb((u_quad_t)qup->dqblk.dqb_bhardlimit))); + (void)fprintf(fd, "%s %lu, limits (soft = %lu, hard = %lu)\n", "\tinodes in use:", qup->dqblk.dqb_curinodes, qup->dqblk.dqb_isoftlimit, qup->dqblk.dqb_ihardlimit); } |