X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fmemory.c;h=7e4e7543adc7f6a575ae3ea72a327555770594fe;hb=e8999694aac7184ac4eea29564a2892f188c4171;hp=ebaa8f29ce76f9e2bc9681c0a6a9d17376f5e9bb;hpb=6d86a97190a193863aadc252f20f6b9dba61c263;p=collectd.git diff --git a/src/memory.c b/src/memory.c index ebaa8f29..7e4e7543 100644 --- a/src/memory.c +++ b/src/memory.c @@ -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);