projects
/
unix-history
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
tags
|
clone url
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
(no message)
[unix-history]
/
usr
/
src
/
usr.bin
/
quota
/
quota.c
diff --git
a/usr/src/usr.bin/quota/quota.c
b/usr/src/usr.bin/quota/quota.c
index
0d09e1f
..
eab9667
100644
(file)
--- a/
usr/src/usr.bin/quota/quota.c
+++ b/
usr/src/usr.bin/quota/quota.c
@@
-1,5
+1,5
@@
#ifndef lint
#ifndef lint
-static char sccsid[] = "@(#)quota.c 4.
1
(Berkeley, from Melbourne) %G%";
+static char sccsid[] = "@(#)quota.c 4.
4
(Berkeley, from Melbourne) %G%";
#endif
/*
#endif
/*
@@
-11,7
+11,6
@@
static char sccsid[] = "@(#)quota.c 4.1 (Berkeley, from Melbourne) %G%";
#include <pwd.h>
#include <sys/param.h>
#include <pwd.h>
#include <sys/param.h>
-#define QUOTA
#include <sys/quota.h>
#include <sys/file.h>
#include <sys/stat.h>
#include <sys/quota.h>
#include <sys/file.h>
#include <sys/stat.h>
@@
-20,6
+19,7
@@
int qflag;
int vflag;
int done;
int morethanone;
int vflag;
int done;
int morethanone;
+char *qfname = "quotas";
main(argc, argv)
char *argv[];
main(argc, argv)
char *argv[];
@@
-105,20
+105,20
@@
showquotas(uid, name)
dev_t fsdev;
struct stat statb;
struct dqblk dqblk;
dev_t fsdev;
struct stat statb;
struct dqblk dqblk;
- char qfname[MAXPATHLEN + 1], iwarn[8], dwarn[8];
+ char qf
ile
name[MAXPATHLEN + 1], iwarn[8], dwarn[8];
if (stat(fs->fs_spec, &statb) < 0)
continue;
fsdev = statb.st_rdev;
if (stat(fs->fs_spec, &statb) < 0)
continue;
fsdev = statb.st_rdev;
- (void) sprintf(qf
name, "%s/%s", fs->fs_file, fs->fs_quotafil
e);
- if (stat(qfname, &statb) < 0 || statb.st_dev != fsdev)
+ (void) sprintf(qf
ilename, "%s/%s", fs->fs_file, qfnam
e);
+ if (stat(qf
ile
name, &statb) < 0 || statb.st_dev != fsdev)
continue;
if (quota(Q_GETDLIM, uid, fsdev, &dqblk) != 0) {
continue;
if (quota(Q_GETDLIM, uid, fsdev, &dqblk) != 0) {
- register fd = open(qf
name, F
RDONLY);
+ register fd = open(qf
ilename, O_
RDONLY);
if (fd < 0)
continue;
if (fd < 0)
continue;
- lseek(fd, (long)(uid * sizeof (dqblk)),
FSEEK_ABSOLUTE
);
+ lseek(fd, (long)(uid * sizeof (dqblk)),
L_SET
);
if (read(fd, &dqblk, sizeof dqblk) != sizeof (dqblk)) {
close(fd);
continue;
if (read(fd, &dqblk, sizeof dqblk) != sizeof (dqblk)) {
close(fd);
continue;
@@
-164,17
+164,17
@@
showquotas(uid, name)
}
if (vflag || dqblk.dqb_curblocks || dqblk.dqb_curinodes) {
heading(uid, name);
}
if (vflag || dqblk.dqb_curblocks || dqblk.dqb_curinodes) {
heading(uid, name);
- printf("%
8
s%8d%c%7d%8d%8s%8d%c%7d%8d%8s\n"
+ printf("%
10
s%8d%c%7d%8d%8s%8d%c%7d%8d%8s\n"
, fs->fs_file
, fs->fs_file
- , (dqblk.dqb_curblocks /
(1024/DEV_BSIZE
))
+ , (dqblk.dqb_curblocks /
btodb(1024
))
, (msgb == (char *)0) ? ' ' : '*'
, (msgb == (char *)0) ? ' ' : '*'
- , (dqblk.dqb_bsoftlimit /
(1024/DEV_BSIZE
))
- , (
(dqblk.dqb_bhardlimit-1) / (1024/DEV_BSIZE
))
+ , (dqblk.dqb_bsoftlimit /
btodb(1024
))
+ , (
dqblk.dqb_bhardlimit / btodb(1024
))
, dwarn
, dqblk.dqb_curinodes
, (msgi == (char *)0) ? ' ' : '*'
, dqblk.dqb_isoftlimit
, dwarn
, dqblk.dqb_curinodes
, (msgi == (char *)0) ? ' ' : '*'
, dqblk.dqb_isoftlimit
- , dqblk.dqb_ihardlimit
-1
+ , dqblk.dqb_ihardlimit
, iwarn
);
}
, iwarn
);
}
@@
-207,7
+207,7
@@
heading(uid, name)
putchar('\n');
xprintf("Disc quotas for %s (uid %d):", name, uid);
xprintf(0);
putchar('\n');
xprintf("Disc quotas for %s (uid %d):", name, uid);
xprintf(0);
- printf("%
8
s%8s %7s%8s%8s%8s %7s%8s%8s\n"
+ printf("%
10
s%8s %7s%8s%8s%8s %7s%8s%8s\n"
, "Filsys"
, "current"
, "quota"
, "Filsys"
, "current"
, "quota"