pflogd(8): lower WARNS and fix logic errors
authorJohn Marino <draco@marino.st>
Tue, 10 Feb 2015 22:17:53 +0000 (23:17 +0100)
committerJohn Marino <draco@marino.st>
Tue, 10 Feb 2015 22:17:53 +0000 (23:17 +0100)
The contrib files trigger a new -Wunused-value warning, so lower WARNS
to 3 to suppress that.  Also, a [logical-not-parenthesis] error was
triggering [-Werror=bool-compare].  Fixing it fixed the compare too.

usr.sbin/pflogd/Makefile
usr.sbin/pflogd/pflogd.c

index 5876626..8bcd9c2 100644 (file)
@@ -3,7 +3,7 @@
 LDADD+= -lpcap -lutil
 DPADD+=        ${LIBPCAP} ${LIBUTIL}
 CFLAGS+= -DHAVE_SNPRINTF -I${.CURDIR}/../../contrib/libpcap
-WARNS?=        5
+WARNS?=        3
 
 PROG=  pflogd
 SRCS=  pflogd.c privsep.c privsep_fdpass.c
index 9513ab4..da38dd7 100644 (file)
@@ -722,7 +722,7 @@ main(int argc, char **argv)
                np = pcap_dispatch(hpcap, PCAP_NUM_PKTS,
                    phandler, (u_char *)dpcap);
                if (np < 0) {
-                       if (!if_exists(__DECONST(char *, interface)) == -1) {
+                       if (!(if_exists(__DECONST(char *, interface)) == -1)) {
                                logmsg(LOG_NOTICE, "interface %s went away",
                                    interface);
                                ret = -1;