From 6bff85ff9a293c67840c40974e821c9fc76bff71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dag-Erling=20Sm=C3=B8rgrav?= Date: Fri, 11 May 2018 00:01:43 +0000 Subject: [PATCH] Reduce pollution. While includes unconditionally, it is only actually used in code which is conditional on _KERNEL. Make the #include itself conditional as well, and fix userland code that uses for other purposes but relied on to bring it in. MFC after: 1 week --- lib/libkvm/kvm_getswapinfo.c | 1 + lib/libmemstat/memstat.c | 1 + sys/sys/sysctl.h | 2 ++ usr.bin/systat/ifstat.c | 1 + usr.bin/systat/tcp.c | 1 + usr.sbin/route6d/route6d.c | 1 + usr.sbin/rtadvd/rrenum.c | 1 + 7 files changed, 8 insertions(+) diff --git a/lib/libkvm/kvm_getswapinfo.c b/lib/libkvm/kvm_getswapinfo.c index 979ef71747e1..747ab5076ecd 100644 --- a/lib/libkvm/kvm_getswapinfo.c +++ b/lib/libkvm/kvm_getswapinfo.c @@ -33,6 +33,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include diff --git a/lib/libmemstat/memstat.c b/lib/libmemstat/memstat.c index 978a08189415..4e97ba6779df 100644 --- a/lib/libmemstat/memstat.c +++ b/lib/libmemstat/memstat.c @@ -29,6 +29,7 @@ */ #include +#include #include #include diff --git a/sys/sys/sysctl.h b/sys/sys/sysctl.h index 9c6009a70c0b..8264f681bcc0 100644 --- a/sys/sys/sysctl.h +++ b/sys/sys/sysctl.h @@ -38,7 +38,9 @@ #ifndef _SYS_SYSCTL_H_ #define _SYS_SYSCTL_H_ +#ifdef _KERNEL #include +#endif struct thread; /* diff --git a/usr.bin/systat/ifstat.c b/usr.bin/systat/ifstat.c index 4c174c0b89e1..040b0e6f6270 100644 --- a/usr.bin/systat/ifstat.c +++ b/usr.bin/systat/ifstat.c @@ -32,6 +32,7 @@ #include #include +#include #include #include #include diff --git a/usr.bin/systat/tcp.c b/usr.bin/systat/tcp.c index 00417a95b5f1..7dc9f0dfaf50 100644 --- a/usr.bin/systat/tcp.c +++ b/usr.bin/systat/tcp.c @@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include diff --git a/usr.sbin/route6d/route6d.c b/usr.sbin/route6d/route6d.c index ac1c778942cd..07765de70431 100644 --- a/usr.sbin/route6d/route6d.c +++ b/usr.sbin/route6d/route6d.c @@ -39,6 +39,7 @@ static const char _rcsid[] = "$KAME: route6d.c,v 1.104 2003/10/31 00:30:20 itoju #include #include #include +#include #include #include #include diff --git a/usr.sbin/rtadvd/rrenum.c b/usr.sbin/rtadvd/rrenum.c index 7e3bac286cc3..f12fcaaed8c7 100644 --- a/usr.sbin/rtadvd/rrenum.c +++ b/usr.sbin/rtadvd/rrenum.c @@ -34,6 +34,7 @@ #include #include #include +#include #include #include