From owner-svn-src-head@freebsd.org Sat Jun 16 23:48:00 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8FB0C1002672; Sat, 16 Jun 2018 23:48:00 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 409BF74312; Sat, 16 Jun 2018 23:48:00 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 050B557BD; Sat, 16 Jun 2018 23:48:00 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5GNlxcT081507; Sat, 16 Jun 2018 23:47:59 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5GNlxkC081505; Sat, 16 Jun 2018 23:47:59 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201806162347.w5GNlxkC081505@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Sat, 16 Jun 2018 23:47:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335268 - head/sbin/quotacheck X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: head/sbin/quotacheck X-SVN-Commit-Revision: 335268 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Jun 2018 23:48:00 -0000 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);