From 0546b9ddc031d596dd0f94d084957b0d4f52754a Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Fri, 15 Aug 2014 10:38:11 +0200 Subject: netsniff-ng: Conditionally define POLLRDNORM where it is used Instead of defining POLLRDNORM in built_in.h if it isn't provided by system/kernel headers, define it in ring.h where its only user is. This way we make sure that is included before checking #ifndef POLLRDNORM. This fixes the following sparse warning: /usr/include/bits/poll.h:32:10: warning: preprocessor token POLLRDNORM redefined built_in.h:378:10: this was the original definition Also remove the defines for POLLWRNORM and POLLRDHUP which are not used anywhere in the code. Signed-off-by: Tobias Klauser --- built_in.h | 12 ------------ ring.h | 4 ++++ 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/built_in.h b/built_in.h index 54444fa..aab4ef6 100644 --- a/built_in.h +++ b/built_in.h @@ -374,18 +374,6 @@ static inline u64 cpu_to_le64(u64 val) # define PACKET_QDISC_BYPASS 20 #endif -#ifndef POLLRDNORM -# define POLLRDNORM 0x0040 -#endif - -#ifndef POLLWRNORM -# define POLLWRNORM 0x0100 -#endif - -#ifndef POLLRDHUP -# define POLLRDHUP 0x2000 -#endif - #ifndef ARPHRD_IEEE802154_MONITOR # define ARPHRD_IEEE802154_MONITOR 805 #endif diff --git a/ring.h b/ring.h index afc8b08..823e49a 100644 --- a/ring.h +++ b/ring.h @@ -26,6 +26,10 @@ #include "dev.h" #include "config.h" +#ifndef POLLRDNORM +# define POLLRDNORM 0x0040 +#endif + union tpacket_uhdr { struct tpacket_hdr *h1; struct tpacket2_hdr *h2; -- cgit v1.2.3-54-g00ecf