svn commit: r335268 - head/sbin/quotacheck
Eitan Adler
eadler at FreeBSD.org
Sat Jun 16 23:48:00 UTC 2018
Author: eadler
Date: Sat Jun 16 23:47:59 2018
New Revision: 335268
URL: https://svnweb.freebsd.org/changeset/base/335268
Log:
quotacheck: build with WARNS=3
WARNS++
Tested with amd64, arm64, i386, mips
Modified:
head/sbin/quotacheck/Makefile
head/sbin/quotacheck/quotacheck.c
Modified: head/sbin/quotacheck/Makefile
==============================================================================
--- head/sbin/quotacheck/Makefile Sat Jun 16 23:45:59 2018 (r335267)
+++ head/sbin/quotacheck/Makefile Sat Jun 16 23:47:59 2018 (r335268)
@@ -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
Modified: head/sbin/quotacheck/quotacheck.c
==============================================================================
--- head/sbin/quotacheck/quotacheck.c Sat Jun 16 23:45:59 2018 (r335267)
+++ head/sbin/quotacheck/quotacheck.c Sat Jun 16 23:47:59 2018 (r335268)
@@ -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
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
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
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
}
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 t
*/
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);
More information about the svn-src-head
mailing list