From 8f8d5b77ec14118037c40e566d20411c9a4dfb85 Mon Sep 17 00:00:00 2001 From: Sascha Wildner Date: Sun, 20 Sep 2009 16:53:31 +0200 Subject: [PATCH] wall(1)/syslogd(8): Raise WARNS to 6 and fix warnings. --- usr.bin/wall/Makefile | 1 - usr.bin/wall/ttymsg.c | 2 +- usr.bin/wall/wall.c | 7 ++++--- usr.sbin/syslogd/Makefile | 1 - 4 files changed, 5 insertions(+), 6 deletions(-) diff --git a/usr.bin/wall/Makefile b/usr.bin/wall/Makefile index 7110505425..46967ae9af 100644 --- a/usr.bin/wall/Makefile +++ b/usr.bin/wall/Makefile @@ -5,6 +5,5 @@ PROG= wall SRCS= ttymsg.c wall.c BINGRP= tty BINMODE=2555 -WARNS?= 2 .include diff --git a/usr.bin/wall/ttymsg.c b/usr.bin/wall/ttymsg.c index 6dc81f5e31..a8d0b3a367 100644 --- a/usr.bin/wall/ttymsg.c +++ b/usr.bin/wall/ttymsg.c @@ -114,7 +114,7 @@ ttymsg(struct iovec *iov, int iovcnt, const char *line, int tmout) --iovcnt; } if (wret) { - iov->iov_base += wret; + iov->iov_base = (char *)iov->iov_base + wret; iov->iov_len -= wret; } continue; diff --git a/usr.bin/wall/wall.c b/usr.bin/wall/wall.c index 4b8b2c119e..c5733e6409 100644 --- a/usr.bin/wall/wall.c +++ b/usr.bin/wall/wall.c @@ -138,7 +138,7 @@ main(int argc, char *argv[]) if (!pw) continue; for (g = grouplist; g && ingroup == 0; g = g->next) { - if (g->gid == -1) + if (g->gid == (gid_t)-1) continue; if (g->gid == pw->pw_gid) ingroup = 1; @@ -180,7 +180,8 @@ makemsg(char *fname) time_t now; FILE *fp; int fd; - char *p, *tty, hostname[MAXHOSTNAMELEN], lbuf[256], tmpname[MAXPATHLEN]; + char *p, hostname[MAXHOSTNAMELEN], lbuf[256], tmpname[MAXPATHLEN]; + const char *tty; const char *whom; gid_t egid; @@ -278,7 +279,7 @@ makemsg(char *fname) mbufsize = sbuf.st_size; if (!(mbuf = malloc((u_int)mbufsize))) err(1, "out of memory"); - if (fread(mbuf, sizeof(*mbuf), mbufsize, fp) != mbufsize) + if ((int)fread(mbuf, sizeof(*mbuf), mbufsize, fp) != mbufsize) err(1, "can't read temporary file"); (void)close(fd); } diff --git a/usr.sbin/syslogd/Makefile b/usr.sbin/syslogd/Makefile index f2567e1b03..147b496148 100644 --- a/usr.sbin/syslogd/Makefile +++ b/usr.sbin/syslogd/Makefile @@ -11,7 +11,6 @@ SRCS= pidfile.c syslogd.c ttymsg.c DPADD= ${LIBUTIL} LDADD= -lutil -WARNS?= 2 CFLAGS+= -DINET6 CFLAGS+= -I${.CURDIR}/../../usr.bin/wall -- 2.11.4.GIT