wall(1)/syslogd(8): Raise WARNS to 6 and fix warnings.
authorSascha Wildner <saw@online.de>
Sun, 20 Sep 2009 14:53:31 +0000 (16:53 +0200)
committerSascha Wildner <saw@online.de>
Sun, 20 Sep 2009 14:53:31 +0000 (16:53 +0200)
usr.bin/wall/Makefile
usr.bin/wall/ttymsg.c
usr.bin/wall/wall.c
usr.sbin/syslogd/Makefile

index 7110505..46967ae 100644 (file)
@@ -5,6 +5,5 @@ PROG=   wall
 SRCS=  ttymsg.c wall.c
 BINGRP=        tty
 BINMODE=2555
-WARNS?=        2
 
 .include <bsd.prog.mk>
index 6dc81f5..a8d0b3a 100644 (file)
@@ -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;
index 4b8b2c1..c5733e6 100644 (file)
@@ -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);
 }
index f2567e1..147b496 100644 (file)
@@ -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