X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fmemory.c;h=6ea6205e1ca51a72569bc352294e441cb3e6aed6;hb=de0fdb208de123fe753c5fcf03533833777a5b4a;hp=ebaa8f29ce76f9e2bc9681c0a6a9d17376f5e9bb;hpb=d54dfab9b049de396e6a38d690d5f18917e093ea;p=collectd.git diff --git a/src/memory.c b/src/memory.c index ebaa8f29..6ea6205e 100644 --- a/src/memory.c +++ b/src/memory.c @@ -1,6 +1,6 @@ /** * collectd - src/memory.c - * Copyright (C) 2005-2007 Florian octo Forster + * Copyright (C) 2005-2008 Florian octo Forster * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the @@ -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); @@ -205,7 +208,7 @@ static int memory_read (void) NULL, 0) == 0) { sysctl_vals[i] = value; - DEBUG ("memory plugin: %26s: %6i", sysctl_keys[i], sysctl_vals[i]); + DEBUG ("memory plugin: %26s: %g", sysctl_keys[i], sysctl_vals[i]); } else {