X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fzfs_arc.c;h=b784ee3a3fc1374a66e03f12b432c625ae48dce1;hb=7cea19815ba24735e91dde1c08a889960b299b62;hp=e32e829d5a10b5a6d4a6577dc6bcda7de5323f88;hpb=9f594db8977f32dd2683ceecd1d47281abc99adf;p=collectd.git diff --git a/src/zfs_arc.c b/src/zfs_arc.c index e32e829d..b784ee3a 100644 --- a/src/zfs_arc.c +++ b/src/zfs_arc.c @@ -53,7 +53,7 @@ static long long get_zfs_value(kstat_t *zfs_stats __attribute__((unused)), return (-1); } - return ((long long int)e->value); + return (*(long long int*)e->value); } #elif !defined(__FreeBSD__) // Solaris @@ -208,7 +208,7 @@ static int za_read (void) { llentry_t *e; llvalues = malloc(sizeof(long long int) * i); - i = 0; + int j = 0; pnl = file_contents; while (pnl != NULL) @@ -220,9 +220,9 @@ static int za_read (void) numfields = strsplit (pnl, fields, 4); if (numfields == 3) { - llvalues[i] = atoll (fields[2]); + llvalues[j] = atoll (fields[2]); - e = llentry_create (fields[0], (void *)llvalues[i]); + e = llentry_create (fields[0], &llvalues[j]); if (e == NULL) { ERROR ("zfs_arc plugin: `llentry_create' failed."); @@ -231,6 +231,7 @@ static int za_read (void) { llist_append (ksp, e); } + j++; } pnl = pnnl; if (pnl != NULL)