Code

Merge branch 'collectd-4.5' into collectd-4.6
[collectd.git] / src / memory.c
index ebaa8f29ce76f9e2bc9681c0a6a9d17376f5e9bb..7e4e7543adc7f6a575ae3ea72a327555770594fe 100644 (file)
@@ -92,8 +92,11 @@ static int memory_init (void)
 #elif defined(HAVE_LIBKSTAT)
        /* getpagesize(3C) tells me this does not fail.. */
        pagesize = getpagesize ();
-       if (get_kstat (&ksp, "unix", 0, "system_pages"))
+       if (get_kstat (&ksp, "unix", 0, "system_pages") != 0)
+       {
                ksp = NULL;
+               return (-1);
+       }
 #endif /* HAVE_LIBKSTAT */
 
        return (0);