Merge pull request #3298 from rubenk/contextswitch-nosysctl-h
authorMatthias Runge <mrunge@redhat.com>
Fri, 11 Oct 2019 06:59:29 +0000 (08:59 +0200)
committerGitHub <noreply@github.com>
Fri, 11 Oct 2019 06:59:29 +0000 (08:59 +0200)
Only include <sys/sysctl.h> when needed

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 */