projects
/
collectd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge pull request #1842 from rubenk/declare-loop-variable-in-for-loop-controlling...
[collectd.git]
/
src
/
nfs.c
diff --git
a/src/nfs.c
b/src/nfs.c
index
0948bc7
..
c128c81
100644
(file)
--- a/
src/nfs.c
+++ b/
src/nfs.c
@@
-23,6
+23,7
@@
**/
#include "collectd.h"
**/
#include "collectd.h"
+
#include "common.h"
#include "plugin.h"
#include "common.h"
#include "plugin.h"
@@
-345,8
+346,6
@@
static int nfs_init (void)
#elif HAVE_LIBKSTAT
static int nfs_init (void)
{
#elif HAVE_LIBKSTAT
static int nfs_init (void)
{
- kstat_t *ksp_chain = NULL;
-
nfs2_ksp_client = NULL;
nfs2_ksp_server = NULL;
nfs3_ksp_client = NULL;
nfs2_ksp_client = NULL;
nfs2_ksp_server = NULL;
nfs3_ksp_client = NULL;
@@
-357,7
+356,7
@@
static int nfs_init (void)
if (kc == NULL)
return (-1);
if (kc == NULL)
return (-1);
- for (ksp_chain = kc->kc_chain; ksp_chain != NULL;
+ for (ks
tat_t *ks
p_chain = kc->kc_chain; ksp_chain != NULL;
ksp_chain = ksp_chain->ks_next)
{
if (strncmp (ksp_chain->ks_module, "nfs", 3) != 0)
ksp_chain = ksp_chain->ks_next)
{
if (strncmp (ksp_chain->ks_module, "nfs", 3) != 0)
@@
-385,7
+384,6
@@
static void nfs_procedures_submit (const char *plugin_instance,
value_t *values, size_t values_num)
{
value_list_t vl = VALUE_LIST_INIT;
value_t *values, size_t values_num)
{
value_list_t vl = VALUE_LIST_INIT;
- size_t i;
vl.values_len = 1;
sstrncpy (vl.host, hostname_g, sizeof (vl.host));
vl.values_len = 1;
sstrncpy (vl.host, hostname_g, sizeof (vl.host));
@@
-394,7
+392,7
@@
static void nfs_procedures_submit (const char *plugin_instance,
sizeof (vl.plugin_instance));
sstrncpy (vl.type, "nfs_procedure", sizeof (vl.type));
sizeof (vl.plugin_instance));
sstrncpy (vl.type, "nfs_procedure", sizeof (vl.type));
- for (i = 0; i < values_num; i++)
+ for (
size_t
i = 0; i < values_num; i++)
{
vl.values = values + i;
sstrncpy (vl.type_instance, type_instances[i],
{
vl.values = values + i;
sstrncpy (vl.type_instance, type_instances[i],
@@
-409,12
+407,11
@@
static void nfs_submit_fields (int nfs_version, const char *instance,
{
char plugin_instance[DATA_MAX_NAME_LEN];
value_t values[fields_num];
{
char plugin_instance[DATA_MAX_NAME_LEN];
value_t values[fields_num];
- size_t i;
ssnprintf (plugin_instance, sizeof (plugin_instance), "v%i%s",
nfs_version, instance);
ssnprintf (plugin_instance, sizeof (plugin_instance), "v%i%s",
nfs_version, instance);
- for (i = 0; i < fields_num; i++)
+ for (
size_t
i = 0; i < fields_num; i++)
(void) parse_value (fields[i], &values[i], DS_TYPE_DERIVE);
nfs_procedures_submit (plugin_instance, proc_names, values,
(void) parse_value (fields[i], &values[i], DS_TYPE_DERIVE);
nfs_procedures_submit (plugin_instance, proc_names, values,
@@
-608,7
+605,6
@@
static int nfs_read_kstat (kstat_t *ksp, int nfs_version, const char *inst,
{
char plugin_instance[DATA_MAX_NAME_LEN];
value_t values[proc_names_num];
{
char plugin_instance[DATA_MAX_NAME_LEN];
value_t values[proc_names_num];
- size_t i;
if (ksp == NULL)
return (EINVAL);
if (ksp == NULL)
return (EINVAL);
@@
-617,7
+613,7
@@
static int nfs_read_kstat (kstat_t *ksp, int nfs_version, const char *inst,
nfs_version, inst);
kstat_read(kc, ksp, NULL);
nfs_version, inst);
kstat_read(kc, ksp, NULL);
- for (i = 0; i < proc_names_num; i++)
+ for (
size_t
i = 0; i < proc_names_num; i++)
{
/* The name passed to kstat_data_lookup() doesn't have the
* "const" modifier, so we need to copy the name here. */
{
/* The name passed to kstat_data_lookup() doesn't have the
* "const" modifier, so we need to copy the name here. */