summaryrefslogtreecommitdiffstats
path: root/usr.sbin/repquota
diff options
context:
space:
mode:
authorangelos <angelos@openbsd.org>2001-01-14 23:03:05 +0000
committerangelos <angelos@openbsd.org>2001-01-14 23:03:05 +0000
commit717081f3a0758d64df8128003d12dd29c0423b0e (patch)
treeefa372cb8aa78610074c6c68198cce9abfa819be /usr.sbin/repquota
parentCompute UDP checksum, PR 1621 (matthieu.herrb@wanadoo.fr) (diff)
downloadwireguard-openbsd-717081f3a0758d64df8128003d12dd29c0423b0e.tar.xz
wireguard-openbsd-717081f3a0758d64df8128003d12dd29c0423b0e.zip
Handle quotas over 4G, PR 1534 (bob@prophecy.lu)
Diffstat (limited to 'usr.sbin/repquota')
-rw-r--r--usr.sbin/repquota/repquota.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/usr.sbin/repquota/repquota.c b/usr.sbin/repquota/repquota.c
index dd452325b26..d9bdc324daa 100644
--- a/usr.sbin/repquota/repquota.c
+++ b/usr.sbin/repquota/repquota.c
@@ -42,7 +42,7 @@ static char copyright[] =
#ifndef lint
/*static char sccsid[] = "from: @(#)repquota.c 8.1 (Berkeley) 6/6/93";*/
-static char *rcsid = "$Id: repquota.c,v 1.12 2000/12/21 09:50:00 pjanzen Exp $";
+static char *rcsid = "$Id: repquota.c,v 1.13 2001/01/14 23:03:05 angelos Exp $";
#endif /* not lint */
/*
@@ -59,6 +59,12 @@ static char *rcsid = "$Id: repquota.c,v 1.12 2000/12/21 09:50:00 pjanzen Exp $";
#include <string.h>
#include <errno.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;
@@ -226,19 +232,16 @@ repquota(fs, type, qfpathname)
fup->fu_dqblk.dqb_curblocks == 0)
continue;
printf("%-10s", fup->fu_name);
- printf("%c%c%8d%8d%8d%7s",
+ printf("%c%c%8lu%8lu%8lu%7s",
fup->fu_dqblk.dqb_bsoftlimit &&
fup->fu_dqblk.dqb_curblocks >=
fup->fu_dqblk.dqb_bsoftlimit ? '+' : '-',
fup->fu_dqblk.dqb_isoftlimit &&
fup->fu_dqblk.dqb_curinodes >=
fup->fu_dqblk.dqb_isoftlimit ? '+' : '-',
- (int)(dbtob((u_quad_t)fup->fu_dqblk.dqb_curblocks)
- / 1024),
- (int)(dbtob((u_quad_t)fup->fu_dqblk.dqb_bsoftlimit)
- / 1024),
- (int)(dbtob((u_quad_t)fup->fu_dqblk.dqb_bhardlimit)
- / 1024),
+ (int)(dbtokb((u_quad_t)fup->fu_dqblk.dqb_curblocks)),
+ (int)(dbtokb((u_quad_t)fup->fu_dqblk.dqb_bsoftlimit)),
+ (int)(dbtokb((u_quad_t)fup->fu_dqblk.dqb_bhardlimit)),
fup->fu_dqblk.dqb_bsoftlimit &&
fup->fu_dqblk.dqb_curblocks >=
fup->fu_dqblk.dqb_bsoftlimit ?