* Copyright (C) 2012 Aurelien Rougemont
* Copyright (C) 2013 Xin Li
* Copyright (C) 2014 Marc Fournier
+ * Copyright (C) 2014 Wilfried Goesgens
*
* 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
* Aurelien Rougemont <beorn at gandi.net>
* Xin Li <delphij at FreeBSD.org>
* Marc Fournier <marc.fournier at camptocamp.com>
+ * Wilfried Goesgens <dothebart at citadel.org>
**/
#include "collectd.h"
return (-1);
}
- return ((long long int)e->value);
+ return (*(long long int*)e->value);
}
#elif !defined(__FreeBSD__) // Solaris
{
llentry_t *e;
llvalues = malloc(sizeof(long long int) * i);
- i = 0;
+ int j = 0;
pnl = file_contents;
while (pnl != NULL)
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.");
{
llist_append (ksp, e);
}
+ j++;
}
pnl = pnnl;
if (pnl != NULL)