diff --git a/src/memory.c b/src/memory.c
index 6c89dbcb77110070fa3eab995cb00cd728ab9c6f..b8b7229f6de74db7f6a2161370c58f08934ff28b 100644 (file)
--- a/src/memory.c
+++ b/src/memory.c
#include "collectd.h"
#include "common.h"
#include "plugin.h"
#include "collectd.h"
#include "common.h"
#include "plugin.h"
+#include "utils_debug.h"
#ifdef HAVE_SYS_SYSCTL_H
# include <sys/sysctl.h>
#ifdef HAVE_SYS_SYSCTL_H
# include <sys/sysctl.h>
#ifdef HAVE_MACH_HOST_PRIV_H
# include <mach/host_priv.h>
#endif
#ifdef HAVE_MACH_HOST_PRIV_H
# include <mach/host_priv.h>
#endif
-#ifdef MACH_VM_STATISTICS_H
+#ifdef HAVE_MACH_VM_STATISTICS_H
# include <mach/vm_statistics.h>
#endif
# include <mach/vm_statistics.h>
#endif
{
len = sizeof (int);
if ((status = sysctlbyname (sysctl_keys[i],
{
len = sizeof (int);
if ((status = sysctlbyname (sysctl_keys[i],
- (void *) &sysctl_vals[i], len,
+ (void *) &sysctl_vals[i], &len,
NULL, 0)) < 0)
{
syslog (LOG_ERR, "memory plugin: sysctlbyname (%s): %s",
NULL, 0)) < 0)
{
syslog (LOG_ERR, "memory plugin: sysctlbyname (%s): %s",
- sysctl_keys[i], strerror (status));
+ sysctl_keys[i], strerror (errno));
return;
}
DBG ("%26s: %6i", sysctl_keys[i], sysctl_vals[i]);
return;
}
DBG ("%26s: %6i", sysctl_keys[i], sysctl_vals[i]);