Skip to content

Commit

Permalink
Reduce <sys/queue.h> pollution.
Browse files Browse the repository at this point in the history
While <sys/sysctl.h> includes <sys/queue.h> 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 <sys/queue.h>
for other purposes but relied on <sys/sysctl.h> to bring it in.

MFC after:	1 week
  • Loading branch information
dag-erling committed May 11, 2018
1 parent c395575 commit 6bff85f
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/libkvm/kvm_getswapinfo.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ __FBSDID("$FreeBSD$");
#include <sys/time.h>
#include <sys/stat.h>
#include <sys/blist.h>
#include <sys/queue.h>
#include <sys/sysctl.h>

#include <vm/swap_pager.h>
Expand Down
1 change: 1 addition & 0 deletions lib/libmemstat/memstat.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
*/

#include <sys/param.h>
#include <sys/queue.h>
#include <sys/sysctl.h>

#include <err.h>
Expand Down
2 changes: 2 additions & 0 deletions sys/sys/sysctl.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@
#ifndef _SYS_SYSCTL_H_
#define _SYS_SYSCTL_H_

#ifdef _KERNEL
#include <sys/queue.h>
#endif

struct thread;
/*
Expand Down
1 change: 1 addition & 0 deletions usr.bin/systat/ifstat.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@

#include <sys/types.h>
#include <sys/socket.h>
#include <sys/queue.h>
#include <sys/sysctl.h>
#include <net/if.h>
#include <net/if_mib.h>
Expand Down
1 change: 1 addition & 0 deletions usr.bin/systat/tcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$");
#include <sys/param.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/queue.h>
#include <sys/sysctl.h>

#include <netinet/in.h>
Expand Down
1 change: 1 addition & 0 deletions usr.sbin/route6d/route6d.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ static const char _rcsid[] = "$KAME: route6d.c,v 1.104 2003/10/31 00:30:20 itoju
#include <sys/param.h>
#include <sys/file.h>
#include <sys/ioctl.h>
#include <sys/queue.h>
#include <sys/socket.h>
#include <sys/sysctl.h>
#include <sys/uio.h>
Expand Down
1 change: 1 addition & 0 deletions usr.sbin/rtadvd/rrenum.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
#include <sys/types.h>
#include <sys/param.h>
#include <sys/ioctl.h>
#include <sys/queue.h>
#include <sys/socket.h>
#include <sys/sysctl.h>

Expand Down

0 comments on commit 6bff85f

Please sign in to comment.