summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 8ee506f)
raw | patch | inline | side by side (parent: 8ee506f)
author | Florian Forster <octo@huhu.verplant.org> | |
Sat, 18 Apr 2009 11:12:23 +0000 (13:12 +0200) | ||
committer | Florian Forster <octo@huhu.verplant.org> | |
Sat, 18 Apr 2009 11:12:23 +0000 (13:12 +0200) |
src/memory.c | patch | blob | history |
diff --git a/src/memory.c b/src/memory.c
index 0926c595ad1917d59c5c29bbf424b9e5c18b1d74..d6c3c88837d2ca408440ee56d6bba2bf8f9b9d1c 100644 (file)
--- a/src/memory.c
+++ b/src/memory.c
#elif HAVE_SYSCTL
pagesize = getpagesize ();
+ if (pagesize <= 0)
+ {
+ ERROR ("memory plugin: Invalid pagesize: %i", pagesize);
+ return (-1);
+ }
/* #endif HAVE_SYSCTL */
#elif HAVE_SYSCTLBYNAME
struct vmtotal vmtotal;
size_t size;
- if (pagesize <= 0)
- {
- ERROR ("memory plugin: Invalid pagesize: %i", pagesize);
- return (-1);
- }
-
memset (&vmtotal, 0, sizeof (vmtotal));
size = sizeof (vmtotal);
return (-1);
}
+ assert (pagesize > 0);
memory_submit ("active", vmtotal.t_arm * pagesize);
memory_submit ("inactive", (vmtotal.t_rm - vmtotal.t_arm) * pagesize);
memory_submit ("free", vmtotal.t_free * pagesize);