SCCS-vsn: usr.bin/quota/quota.c 4.5
-static char sccsid[] = "@(#)quota.c 4.4 (Berkeley, from Melbourne) %G%";
+static char sccsid[] = "@(#)quota.c 4.5 (Berkeley, from Melbourne) %G%";
#include <fstab.h>
#include <ctype.h>
#include <pwd.h>
#include <fstab.h>
#include <ctype.h>
#include <pwd.h>
#include <sys/param.h>
#include <sys/quota.h>
#include <sys/param.h>
#include <sys/quota.h>
char *argv[];
{
register char *cp;
char *argv[];
{
register char *cp;
+ if (quota(Q_SYNC, 0, 0, 0) < 0 && errno == EINVAL) {
+ fprintf(stderr, "There are no quotas on this system\n");
+ exit(0);
+ }
argc--,argv++;
while (argc > 0) {
if (argv[0][0] == '-')
argc--,argv++;
while (argc > 0) {
if (argv[0][0] == '-')
{
register char c, *p;
register struct fstab *fs;
{
register char c, *p;
register struct fstab *fs;
+ register char *msgi = (char *)0, *msgb = (char *)0;
+ register enab = 1;
+ dev_t fsdev;
+ struct stat statb;
+ struct dqblk dqblk;
+ int myuid, fd;
+ char qfilename[MAXPATHLEN + 1], iwarn[8], dwarn[8];
myuid = getuid();
if (uid != myuid && myuid != 0) {
myuid = getuid();
if (uid != myuid && myuid != 0) {
done = 0;
setfsent();
while (fs = getfsent()) {
done = 0;
setfsent();
while (fs = getfsent()) {
- register char *msgi = (char *)0, *msgb = (char *)0;
- register enab = 1;
- dev_t fsdev;
- struct stat statb;
- struct dqblk dqblk;
- char qfilename[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;
if (stat(qfilename, &statb) < 0 || statb.st_dev != fsdev)
continue;
if (quota(Q_GETDLIM, uid, fsdev, &dqblk) != 0) {
if (stat(qfilename, &statb) < 0 || statb.st_dev != fsdev)
continue;
if (quota(Q_GETDLIM, uid, fsdev, &dqblk) != 0) {
- register fd = open(qfilename, O_RDONLY);
-
+ fd = open(qfilename, O_RDONLY);
if (fd < 0)
continue;
lseek(fd, (long)(uid * sizeof (dqblk)), L_SET);
if (fd < 0)
continue;
lseek(fd, (long)(uid * sizeof (dqblk)), L_SET);