summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 981d7e5)
raw | patch | inline | side by side (parent: 981d7e5)
author | Florian Forster <octo@collectd.org> | |
Sun, 3 Feb 2013 09:43:59 +0000 (10:43 +0100) | ||
committer | Florian Forster <octo@collectd.org> | |
Sun, 3 Feb 2013 09:43:59 +0000 (10:43 +0100) |
The header is not self-contained, so we need to include appropriate
headers in the configure check as well.
headers in the configure check as well.
configure.in | patch | blob | history | |
src/pf.c | patch | blob | history |
diff --git a/configure.in b/configure.in
index d50e8021c2aef3ed2a93c3f60bdc97df1731ccae..fc0a1d1c208e03b140455797b67608f54af2bcca 100644 (file)
--- a/configure.in
+++ b/configure.in
AC_CHECK_HEADERS(netinet/ip_compat.h)
have_net_pfvar_h="no"
-AC_CHECK_HEADERS(net/pfvar.h, [have_net_pfvar_h="yes"])
+AC_CHECK_HEADERS(net/pfvar.h,
+ [have_net_pfvar_h="yes"],
+ [have_net_pfvar_h="no"],
+[
+#if HAVE_SYS_IOCTL_H
+# include <sys/ioctl.h>
+#endif
+#if HAVE_SYS_SOCKET_H
+# include <sys/socket.h>
+#endif
+#if HAVE_NET_IF_H
+# include <net/if.h>
+#endif
+])
# For the multimeter plugin
have_termios_h="no"
diff --git a/src/pf.c b/src/pf.c
index 0332c3c1b3a4c7ee62d54b081bdcdf087960273d..44f0c7bcdec158b3244ec6f7b0d9212b9cd652d5 100644 (file)
--- a/src/pf.c
+++ b/src/pf.c
#include "plugin.h"
#include "common.h"
-#include <sys/ioctl.h>
-#include <sys/socket.h>
-#include <net/if.h>
+#if HAVE_SYS_IOCTL_H
+# include <sys/ioctl.h>
+#endif
+#if HAVE_SYS_SOCKET_H
+# include <sys/socket.h>
+#endif
+#if HAVE_NET_IF_H
+# include <net/if.h>
+#endif
+
#include <net/pfvar.h>
-#include <paths.h>
-#include <err.h>
-#include <pwd.h>
#ifndef FCNT_NAMES
# if FCNT_MAX != 3