X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;ds=sidebyside;f=src%2Fzfs_arc.c;h=8feb31d55c0bfc75f571e0398edfef965e8fcc78;hb=ae5cca244ff291c17df1cc36e28f19376958a2eb;hp=540a1db48683232c0cda930665d91cf08cfcd447;hpb=9b7dee8838f56233cea2854a7ddbcad2790609ce;p=collectd.git diff --git a/src/zfs_arc.c b/src/zfs_arc.c index 540a1db4..8feb31d5 100644 --- a/src/zfs_arc.c +++ b/src/zfs_arc.c @@ -208,6 +208,12 @@ static int za_read (void) { llentry_t *e; llvalues = malloc(sizeof(long long int) * i); + if (llvalues == NULL) + { + ERROR ("zfs_arc plugin: `malloc' failed."); + llist_destroy (ksp); + return (-1); + } int j = 0; pnl = file_contents; @@ -264,7 +270,10 @@ static int za_read (void) za_read_derive (ksp, "deleted", "cache_operation", "deleted"); #if __FreeBSD__ za_read_derive (ksp, "allocated","cache_operation", "allocated"); +#if defined(__FreeBSD_version) && (__FreeBSD_version < 1002501) + /* stolen removed from sysctl kstat.zfs.misc.arcstats on FreeBSD 10.2+ */ za_read_derive (ksp, "stolen", "cache_operation", "stolen"); +#endif #endif /* Issue indicators */