summaryrefslogtreecommitdiffstats
path: root/sbin/quotacheck
diff options
context:
space:
mode:
authormpp <mpp@FreeBSD.org>1996-02-27 08:04:48 +0000
committermpp <mpp@FreeBSD.org>1996-02-27 08:04:48 +0000
commit3c0c46721ebeedf5329ddb89031210303c526c4e (patch)
treeb8846e8b9b75e64d509ebe1ddab35de0fc599009 /sbin/quotacheck
parente1d2af37f65ed6ee6417593e6cc61efaf8f0e35a (diff)
downloadFreeBSD-src-3c0c46721ebeedf5329ddb89031210303c526c4e.zip
FreeBSD-src-3c0c46721ebeedf5329ddb89031210303c526c4e.tar.gz
Silence some cc -Wall warnings in quotacheck.
Diffstat (limited to 'sbin/quotacheck')
-rw-r--r--sbin/quotacheck/quotacheck.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/sbin/quotacheck/quotacheck.c b/sbin/quotacheck/quotacheck.c
index 823ed46..4ca71c5 100644
--- a/sbin/quotacheck/quotacheck.c
+++ b/sbin/quotacheck/quotacheck.c
@@ -48,6 +48,7 @@ static char sccsid[] = "@(#)quotacheck.c 8.3 (Berkeley) 1/29/94";
* Fix up / report on disk quotas & usage
*/
#include <sys/param.h>
+#include <sys/queue.h>
#include <sys/stat.h>
#include <ufs/ufs/dinode.h>
@@ -166,13 +167,13 @@ main(argc, argv)
}
if (gflag) {
setgrent();
- while ((gr = getgrent()) != 0)
+ while ((gr = getgrent()) != NULL)
(void) addid((u_long)gr->gr_gid, GRPQUOTA, gr->gr_name);
endgrent();
}
if (uflag) {
setpwent();
- while ((pw = getpwent()) != 0)
+ while ((pw = getpwent()) != NULL)
(void) addid((u_long)pw->pw_uid, USRQUOTA, pw->pw_name);
endpwent();
}
@@ -361,10 +362,10 @@ update(fsname, quotafile, type)
printf("%s: ", fsname);
printf("%-8s fixed:", fup->fu_name);
if (dqbuf.dqb_curinodes != fup->fu_curinodes)
- (void)printf("\tinodes %d -> %d",
+ (void)printf("\tinodes %ld -> %ld",
dqbuf.dqb_curinodes, fup->fu_curinodes);
if (dqbuf.dqb_curblocks != fup->fu_curblocks)
- (void)printf("\tblocks %d -> %d",
+ (void)printf("\tblocks %ld -> %ld",
dqbuf.dqb_curblocks, fup->fu_curblocks);
(void)printf("\n");
}
@@ -382,7 +383,7 @@ update(fsname, quotafile, type)
dqbuf.dqb_itime = 0;
dqbuf.dqb_curinodes = fup->fu_curinodes;
dqbuf.dqb_curblocks = fup->fu_curblocks;
- if (fseek(qfo, offset, SEEK_SET) < 0) {
+ if (fseek(qfo, (long)offset, SEEK_SET) < 0) {
(void) fprintf(stderr,
"quotacheck: %s: seek failed: %s\n",
quotafile, strerror(errno));
@@ -426,7 +427,7 @@ getquotagid()
{
struct group *gr;
- if (gr = getgrnam(quotagroup))
+ if ((gr = getgrnam(quotagroup)) != NULL)
return (gr->gr_gid);
return (-1);
}
@@ -454,7 +455,7 @@ hasquota(fs, type, qfnamep)
}
strcpy(buf, fs->fs_mntops);
for (opt = strtok(buf, ","); opt; opt = strtok(NULL, ",")) {
- if (cp = index(opt, '='))
+ if ((cp = index(opt, '=')) != NULL)
*cp++ = '\0';
if (type == USRQUOTA && strcmp(opt, usrname) == 0)
break;
@@ -503,7 +504,7 @@ addid(id, type, name)
struct fileusage *fup, **fhp;
int len;
- if (fup = lookup(id, type))
+ if ((fup = lookup(id, type)) != NULL)
return (fup);
if (name)
len = strlen(name);
@@ -646,3 +647,4 @@ err(fmt, va_alist)
exit(1);
/* NOTREACHED */
}
+
OpenPOWER on IntegriCloud