Merge pull request #778 from landryb/openbsd_fix_processes_plugin
authorPierre-Yves Ritschard <pyr@spootnik.org>
Thu, 30 Oct 2014 13:03:31 +0000 (14:03 +0100)
committerPierre-Yves Ritschard <pyr@spootnik.org>
Thu, 30 Oct 2014 13:03:31 +0000 (14:03 +0100)
Fix the processes plugin on OpenBSD (#776)

1  2 
configure.ac

diff --combined configure.ac
@@@ -809,9 -809,7 +809,9 @@@ if test "x$have_swapctl" = "xyes"; the
  #  undef _LARGEFILE64_SOURCE
  #endif
  #include <sys/stat.h>
 +#include <sys/param.h>
  #include <sys/swap.h>
 +#include <unistd.h>
  ]]],
  [[[
  int num = swapctl(0, NULL);
  #  undef _LARGEFILE64_SOURCE
  #endif
  #include <sys/stat.h>
 +#include <sys/param.h>
  #include <sys/swap.h>
 +#include <unistd.h>
  ]]],
  [[[
  int num = swapctl(0, NULL, 0);
@@@ -1315,7 -1311,7 +1315,7 @@@ AC_CHECK_MEMBERS([struct kinfo_proc.ki_
  #include <sys/user.h>
        ])
  
- AC_CHECK_MEMBERS([struct kinfo_proc.kp_proc, struct kinfo_proc.kp_eproc],
+ AC_CHECK_MEMBERS([struct kinfo_proc.p_pid, struct kinfo_proc.p_vm_rssize],
        [
                AC_DEFINE(HAVE_STRUCT_KINFO_PROC_OPENBSD, 1,
                        [Define if struct kinfo_proc exists in the OpenBSD variant.])
        plugin_processes="yes"
  fi
  
+ if test "x$with_kvm_getprocs" = "xyes" && test "x$have_struct_kinfo_proc_openbsd" = "xyes"
+ then
+       plugin_processes="yes"
+ fi
  if test "x$with_kvm_getswapinfo" = "xyes"
  then
        plugin_swap="yes"