X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;ds=inline;f=src%2Fnfs.c;h=1dc64b78a1d948a2b9112ceb3c9484691f60042a;hb=98da2aa3ade7446863800c2f219d8a53fb2fbf6f;hp=efe1e0243c55bd540aca566365be4fa4eef9247e;hpb=3be4a68d16f4387608248a023989a8251a506214;p=collectd.git diff --git a/src/nfs.c b/src/nfs.c index efe1e024..1dc64b78 100644 --- a/src/nfs.c +++ b/src/nfs.c @@ -89,6 +89,7 @@ static data_set_t procedure_ds = "nfs_procedure", 1, procedure_dsrc }; +#if NFS_HAVE_READ static const char *nfs2_procedures_names[] = { "null", @@ -194,24 +195,17 @@ static int nfs_init (void) #endif #define BUFSIZE 1024 -#if NFS_HAVE_READ static void nfs_procedures_submit (const char *plugin_instance, unsigned long long *val, const char **names, int len) { value_t values[1]; - value_list_t vl; + value_list_t vl = VALUE_LIST_INIT; int i; vl.values = values; vl.values_len = 1; vl.time = time (NULL); - /* FIXME: do this globally */ - if (gethostname (vl.host, sizeof (vl.host)) != 0) - { - syslog (LOG_ERR, "load plugin: gethostname failed: %s", - strerror (errno)); - return; - } + strcpy (vl.host, hostname); strcpy (vl.plugin, "nfs"); strncpy (vl.plugin_instance, plugin_instance, sizeof (vl.plugin_instance)); @@ -227,7 +221,6 @@ static void nfs_procedures_submit (const char *plugin_instance, plugin_dispatch_values ("nfs_procedure", &vl); } } /* void nfs_procedures_submit */ -#endif /* NFS_HAVE_READ */ #if KERNEL_LINUX static void nfs_read_stats_file (FILE *fh, char *inst) @@ -356,7 +349,6 @@ static void nfs2_read_kstat (kstat_t *ksp, char *inst) } #endif -#if NFS_HAVE_READ static int nfs_read (void) { #if KERNEL_LINUX