Date: Thu, 31 Dec 2015 22:45:00 +0000 (UTC) From: Dimitry Andric <dim@FreeBSD.org> To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r293013 - projects/clang380-import/contrib/pf/pflogd Message-ID: <201512312245.tBVMj0lV078817@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: dim Date: Thu Dec 31 22:45:00 2015 New Revision: 293013 URL: https://svnweb.freebsd.org/changeset/base/293013 Log: Fix a clang 3.8.0 warning in pflogd.c: contrib/pf/pflogd/pflogd.c:769:8: error: logical not is only applied to the left hand side of this comparison [-Werror,-Wlogical-not-parentheses] if (!if_exists(interface) == -1) { ^ ~~ The if_exists() function does not return -1, and even if it did, it would not be the correct way to check. Just ditch the == -1 instead. Obtained from: OpenBSD's pflogd.c 1.49 MFC after: 3 days Modified: projects/clang380-import/contrib/pf/pflogd/pflogd.c Modified: projects/clang380-import/contrib/pf/pflogd/pflogd.c ============================================================================== --- projects/clang380-import/contrib/pf/pflogd/pflogd.c Thu Dec 31 22:34:16 2015 (r293012) +++ projects/clang380-import/contrib/pf/pflogd/pflogd.c Thu Dec 31 22:45:00 2015 (r293013) @@ -766,7 +766,7 @@ main(int argc, char **argv) np = pcap_dispatch(hpcap, PCAP_NUM_PKTS, phandler, (u_char *)dpcap); if (np < 0) { - if (!if_exists(interface) == -1) { + if (!if_exists(interface)) { logmsg(LOG_NOTICE, "interface %s went away", interface); ret = -1;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201512312245.tBVMj0lV078817>