Merge branch 'collectd-4.10' into collectd-5.1
[collectd.git] / src / nfs.c
index cd1a523..461e806 100644 (file)
--- a/src/nfs.c
+++ b/src/nfs.c
@@ -18,6 +18,7 @@
  * Authors:
  *   Jason Pepas <cell at ices.utexas.edu>
  *   Florian octo Forster <octo at verplant.org>
+ *   Cosmin Ioiart <cioiart at gmail.com>
  **/
 
 #include "collectd.h"
@@ -234,11 +235,11 @@ static void nfs_procedures_submit (const char *plugin_instance,
        size_t i;
 
        vl.values_len = 1;
-       sstrncpy(vl.host, hostname_g, sizeof (vl.host));
-       sstrncpy(vl.plugin, "nfs", sizeof (vl.plugin));
-       sstrncpy(vl.plugin_instance, plugin_instance,
+       sstrncpy (vl.host, hostname_g, sizeof (vl.host));
+       sstrncpy (vl.plugin, "nfs", sizeof (vl.plugin));
+       sstrncpy (vl.plugin_instance, plugin_instance,
                        sizeof (vl.plugin_instance));
-       sstrncpy(vl.type, "nfs_procedure", sizeof (vl.type));
+       sstrncpy (vl.type, "nfs_procedure", sizeof (vl.type));
 
        for (i = 0; i < values_num; i++)
        {
@@ -331,10 +332,12 @@ static int nfs_read_kstat (kstat_t *ksp, int nfs_version, char *inst,
 
        kstat_read(kc, ksp, NULL);
        for (i = 0; i < proc_names_num; i++)
-               values[i] = (derive_t) get_kstat_value (ksp, proc_names[i]);
+               values[i].counter = (derive_t) get_kstat_value (ksp,
+                               (char *)proc_names[i]);
 
        nfs_procedures_submit (plugin_instance, proc_names, values,
                        proc_names_num);
+       return (0);
 }
 #endif