Merge pull request #806 from vincentbernat/fix/libstatgrab2
authorPierre-Yves Ritschard <pyr@spootnik.org>
Mon, 17 Nov 2014 12:57:40 +0000 (13:57 +0100)
committerPierre-Yves Ritschard <pyr@spootnik.org>
Mon, 17 Nov 2014 12:57:40 +0000 (13:57 +0100)
libstatgrab: only use one configure test for 0.90 API change

configure.ac
src/memory.c
src/tcpconns.c

index d9a6b67..7b665a9 100644 (file)
@@ -527,7 +527,7 @@ AC_CHECK_HEADERS(linux/un.h, [], [],
 #endif
 ])
 
-AC_CHECK_HEADERS(pwd.h grp.h sys/un.h ctype.h limits.h xfs/xqm.h fs_info.h fshelp.h paths.h mntent.h mnttab.h sys/fstyp.h sys/fs_types.h sys/mntent.h sys/mnttab.h sys/statfs.h sys/statvfs.h sys/vfs.h sys/vfstab.h kvm.h wordexp.h locale.h)
+AC_CHECK_HEADERS(pwd.h grp.h sys/un.h ctype.h limits.h xfs/xqm.h fs_info.h fshelp.h paths.h mntent.h mnttab.h sys/fstyp.h sys/fs_types.h sys/mntent.h sys/mnttab.h sys/statfs.h sys/statvfs.h sys/vfs.h sys/vfstab.h sys/vmmeter.h kvm.h wordexp.h locale.h)
 
 # For the dns plugin
 AC_CHECK_HEADERS(arpa/nameser.h)
index 0f5e1a0..7e7fd8e 100644 (file)
@@ -30,6 +30,9 @@
 #ifdef HAVE_SYS_SYSCTL_H
 # include <sys/sysctl.h>
 #endif
+#ifdef HAVE_SYS_VMMETER_H
+# include <sys/vmmeter.h>
+#endif
 
 #ifdef HAVE_MACH_KERN_RETURN_H
 # include <mach/kern_return.h>
index f716a10..0236c9d 100644 (file)
@@ -951,7 +951,7 @@ static int conn_init (void)
 static int conn_read (void)
 {
   struct inpcbtable table;
-#ifdef __OpenBSD__ || __NetBSD_Version__ > 699002700
+#if !defined(__OpenBSD__) && (defined(__NetBSD_Version__) && __NetBSD_Version__ <= 699002700)
   struct inpcb *head;
 #endif
   struct inpcb *next;
@@ -966,7 +966,7 @@ static int conn_read (void)
   if (status != 0)
     return (-1);
 
-#ifdef __OpenBSD__ || __NetBSD_Version__ > 699002700
+#if defined(__OpenBSD__) || (defined(__NetBSD_Version__) && __NetBSD_Version__ > 699002700)
   /* inpt_queue is a TAILQ on OpenBSD */
   /* Get the first pcb */
   next = (struct inpcb *)TAILQ_FIRST (&table.inpt_queue);
@@ -984,7 +984,7 @@ static int conn_read (void)
     kread ((u_long) next, &inpcb, sizeof (inpcb));
 
     /* Advance `next' */
-#ifdef __OpenBSD__ || __NetBSD_Version__ > 699002700
+#if defined(__OpenBSD__) || (defined(__NetBSD_Version__) && __NetBSD_Version__ > 699002700)
     /* inpt_queue is a TAILQ on OpenBSD */
     next = (struct inpcb *)TAILQ_NEXT (&inpcb, inp_queue);
 #else