contrib/docker: add LD_PRELOAD wrapper to fopen/open/opendir syscalls
[collectd.git] / src / zone.c
index 40c4d2e..bd51c55 100644 (file)
@@ -31,6 +31,7 @@
 #endif
 
 #include "collectd.h"
+
 #include "common.h"
 #include "plugin.h"
 
@@ -48,11 +49,11 @@ typedef struct zone_stats {
 } zone_stats_t;
 
 static int
-zone_compare(const zoneid_t *a, const zoneid_t *b)
+zone_compare(const void *a, const void *b)
 {
-       if (*a == *b)
+       if (*(const zoneid_t *)a == *(const zoneid_t *)b)
                return(0);
-       if (*a < *b)
+       if (*(const zoneid_t *)a < *(const zoneid_t *)b)
                return(-1);
        return(1);
 }
@@ -90,7 +91,6 @@ zone_submit_value(char *zone, gauge_t value)
 
        vl.values = values;
        vl.values_len = 1; /*STATIC_ARRAY_SIZE (values);*/
-       sstrncpy (vl.host, hostname_g, sizeof (vl.host));
        sstrncpy (vl.plugin, "zone", sizeof (vl.plugin));
        sstrncpy (vl.type, "percent", sizeof (vl.type));
        sstrncpy (vl.type_instance, zone, sizeof (vl.type_instance));
@@ -133,7 +133,7 @@ zone_submit_values(c_avl_tree_t *tree)
        while (c_avl_pick (tree, (void **)&zoneid, (void **)&stats) == 0)
        {
                if (getzonenamebyid(*zoneid, zonename, sizeof( zonename )) == -1) {
-                       WARNING("zone plugin: error retreiving zonename");
+                       WARNING("zone plugin: error retrieving zonename");
                } else {
                        zone_submit_value(zonename, (gauge_t)FRC2PCT(stats->pctcpu));
                }
@@ -152,7 +152,7 @@ zone_scandir(DIR *procdir)
        c_avl_tree_t *tree;
        zone_stats_t *stats;
 
-       if (!(tree=c_avl_create((void *) zone_compare))) {
+       if (!(tree=c_avl_create(zone_compare))) {
                WARNING("zone plugin: Failed to create tree");
                return(NULL);
        }