summaryrefslogtreecommitdiff
path: root/sbin/quotacheck
diff options
context:
space:
mode:
authorEitan Adler <eadler@FreeBSD.org>2018-06-16 23:47:59 +0000
committerEitan Adler <eadler@FreeBSD.org>2018-06-16 23:47:59 +0000
commit37e18df37da46cf9e08bc22bf8112fa270d7d8ce (patch)
treeb08516ae9b50135dae61e23a0bd6307e5086f7e0 /sbin/quotacheck
parente567c750ff728982fb5344e11e21894a97c112be (diff)
downloadsrc-test2-37e18df37da46cf9e08bc22bf8112fa270d7d8ce.tar.gz
src-test2-37e18df37da46cf9e08bc22bf8112fa270d7d8ce.zip
quotacheck: build with WARNS=3
WARNS++ Tested with amd64, arm64, i386, mips
Notes
Notes: svn path=/head/; revision=335268
Diffstat (limited to 'sbin/quotacheck')
-rw-r--r--sbin/quotacheck/Makefile2
-rw-r--r--sbin/quotacheck/quotacheck.c19
2 files changed, 11 insertions, 10 deletions
diff --git a/sbin/quotacheck/Makefile b/sbin/quotacheck/Makefile
index 1e02b4486f9d..10bdeb7a9e54 100644
--- a/sbin/quotacheck/Makefile
+++ b/sbin/quotacheck/Makefile
@@ -4,7 +4,7 @@
PACKAGE=quotacheck
PROG= quotacheck
SRCS= quotacheck.c preen.c fsutil.c utilities.c
-WARNS?= 2
+WARNS?= 3
MAN= quotacheck.8
LIBADD= util ufs
diff --git a/sbin/quotacheck/quotacheck.c b/sbin/quotacheck/quotacheck.c
index 7071aaf9dea5..3b192a7a9585 100644
--- a/sbin/quotacheck/quotacheck.c
+++ b/sbin/quotacheck/quotacheck.c
@@ -74,9 +74,9 @@ __FBSDID("$FreeBSD$");
#include "quotacheck.h"
-char *qfname = QUOTAFILENAME;
-char *qfextension[] = INITQFNAMES;
-char *quotagroup = QUOTAGROUP;
+const char *qfname = QUOTAFILENAME;
+const char *qfextension[] = INITQFNAMES;
+const char *quotagroup = QUOTAGROUP;
union {
struct fs sblk;
@@ -253,8 +253,9 @@ chkquota(char *specname, struct quotafile *qfu, struct quotafile *qfg)
struct fileusage *fup;
union dinode *dp;
struct fs *fs;
- int cg, i, ret, mode, errs = 0;
- ino_t ino, inosused, userino = 0, groupino = 0;
+ int i, ret, mode, errs = 0;
+ u_int32_t cg;
+ ino_t curino, ino, inosused, userino = 0, groupino = 0;
dev_t dev, userdev = 0, groupdev = 0;
struct stat sb;
const char *mntpt;
@@ -367,7 +368,7 @@ chkquota(char *specname, struct quotafile *qfu, struct quotafile *qfg)
if (inosused <= 0)
continue;
}
- for (i = 0; i < inosused; i++, ino++) {
+ for (curino = 0; curino < inosused; curino++, ino++) {
if ((dp = getnextinode(ino)) == NULL ||
ino < UFS_ROOTINO ||
(mode = DIP(dp, di_mode) & IFMT) == 0)
@@ -403,7 +404,7 @@ chkquota(char *specname, struct quotafile *qfu, struct quotafile *qfg)
continue;
if (qfg) {
fup = addid((u_long)DIP(dp, di_gid), GRPQUOTA,
- (char *)0, mntpt);
+ NULL, mntpt);
fup->fu_curinodes++;
if (mode == IFREG || mode == IFDIR ||
mode == IFLNK)
@@ -411,7 +412,7 @@ chkquota(char *specname, struct quotafile *qfu, struct quotafile *qfg)
}
if (qfu) {
fup = addid((u_long)DIP(dp, di_uid), USRQUOTA,
- (char *)0, mntpt);
+ NULL, mntpt);
fup->fu_curinodes++;
if (mode == IFREG || mode == IFDIR ||
mode == IFLNK)
@@ -498,7 +499,7 @@ update(const char *fsname, struct quotafile *qf, int type)
*/
if (highid < lastid &&
stat(quota_qfname(qf), &sb) == 0 &&
- sb.st_size > (((off_t)highid + 2) * sizeof(struct dqblk)))
+ sb.st_size > (off_t)((highid + 2) * sizeof(struct dqblk)))
truncate(quota_qfname(qf),
(((off_t)highid + 2) * sizeof(struct dqblk)));
return (0);