From: Marc Fournier Date: Mon, 28 Jul 2014 13:04:24 +0000 (+0200) Subject: zfs_arc: pass reference in llist instead of value X-Git-Tag: collectd-5.5.0~218^2~1 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=3aeea86c1adde5caa7bf18f5054b5acbf359546e;p=collectd.git zfs_arc: pass reference in llist instead of value This avoids using a void pointer, which size depends on the architecture. Thanks to @dothebart for pointing this out! --- diff --git a/src/zfs_arc.c b/src/zfs_arc.c index e32e829d..168d566b 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 @@ -222,7 +222,7 @@ static int za_read (void) { llvalues[i] = atoll (fields[2]); - e = llentry_create (fields[0], (void *)llvalues[i]); + e = llentry_create (fields[0], &llvalues[i]); if (e == NULL) { ERROR ("zfs_arc plugin: `llentry_create' failed.");