projects
/
collectd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge pull request #1832 from rubenk/check-for-c99-compiler
[collectd.git]
/
src
/
memory.c
diff --git
a/src/memory.c
b/src/memory.c
index
ea16ce3
..
6204d35
100644
(file)
--- a/
src/memory.c
+++ b/
src/memory.c
@@
-24,6
+24,7
@@
**/
#include "collectd.h"
**/
#include "collectd.h"
+
#include "common.h"
#include "plugin.h"
#include "common.h"
#include "plugin.h"
@@
-237,7
+238,7
@@
static int memory_read_internal (value_list_t *vl)
* vm.stats.vm.v_inactive_count: 113730
* vm.stats.vm.v_cache_count: 10809
*/
* vm.stats.vm.v_inactive_count: 113730
* vm.stats.vm.v_cache_count: 10809
*/
- char *sysctl_keys[8] =
+ c
onst c
har *sysctl_keys[8] =
{
"vm.stats.vm.v_page_size",
"vm.stats.vm.v_page_count",
{
"vm.stats.vm.v_page_size",
"vm.stats.vm.v_page_count",
@@
-456,13
+457,12
@@
static int memory_read_internal (value_list_t *vl)
#elif HAVE_SYSCTL
int mib[] = {CTL_VM, VM_METER};
#elif HAVE_SYSCTL
int mib[] = {CTL_VM, VM_METER};
- struct vmtotal vmtotal;
+ struct vmtotal vmtotal
= { 0 }
;
gauge_t mem_active;
gauge_t mem_inactive;
gauge_t mem_free;
size_t size;
gauge_t mem_active;
gauge_t mem_inactive;
gauge_t mem_free;
size_t size;
- memset (&vmtotal, 0, sizeof (vmtotal));
size = sizeof (vmtotal);
if (sysctl (mib, 2, &vmtotal, &size, NULL, 0) < 0) {
size = sizeof (vmtotal);
if (sysctl (mib, 2, &vmtotal, &size, NULL, 0) < 0) {
@@
-495,9
+495,8
@@
static int memory_read_internal (value_list_t *vl)
/* #endif HAVE_LIBSTATGRAB */
#elif HAVE_PERFSTAT
/* #endif HAVE_LIBSTATGRAB */
#elif HAVE_PERFSTAT
- perfstat_memory_total_t pmemory;
+ perfstat_memory_total_t pmemory
= { 0 }
;
- memset (&pmemory, 0, sizeof (pmemory));
if (perfstat_memory_total(NULL, &pmemory, sizeof(pmemory), 1) < 0)
{
char errbuf[1024];
if (perfstat_memory_total(NULL, &pmemory, sizeof(pmemory), 1) < 0)
{
char errbuf[1024];