Only include <sys/sysctl.h> when needed
authorRuben Kerkhof <ruben@rubenkerkhof.com>
Wed, 9 Oct 2019 11:47:23 +0000 (13:47 +0200)
committerRuben Kerkhof <ruben@rubenkerkhof.com>
Wed, 9 Oct 2019 11:47:23 +0000 (13:47 +0200)
This plugin doesn't need sysctl.h on Linux.

src/contextswitch.c

index cf3d3da..d23d071 100644 (file)
 #include "plugin.h"
 #include "utils/common/common.h"
 
-#ifdef HAVE_SYS_SYSCTL_H
+#if defined(HAVE_SYSCTLBYNAME) && defined(HAVE_SYS_SYSCTL_H)
 #include <sys/sysctl.h>
-#endif
-
-#if HAVE_SYSCTLBYNAME
 /* no global variables */
 /* #endif HAVE_SYSCTLBYNAME */