numtape = 0;
if (kc == NULL)
- return (-1);
+ return -1;
for (numtape = 0, ksp_chain = kc->kc_chain;
(numtape < MAX_NUMTAPE) && (ksp_chain != NULL);
ksp[numtape++] = ksp_chain;
}
- return (0);
+ return 0;
} /* int tape_init */
static void tape_submit(const char *plugin_instance, const char *type,
derive_t read, derive_t write) {
- value_t values[2];
value_list_t vl = VALUE_LIST_INIT;
-
- values[0].derive = read;
- values[1].derive = write;
+ value_t values[] = {
+ {.derive = read}, {.derive = write},
+ };
vl.values = values;
- vl.values_len = 2;
- sstrncpy(vl.host, hostname_g, sizeof(vl.host));
+ vl.values_len = STATIC_ARRAY_SIZE(values);
sstrncpy(vl.plugin, "tape", sizeof(vl.plugin));
sstrncpy(vl.plugin_instance, plugin_instance, sizeof(vl.plugin_instance));
sstrncpy(vl.type, type, sizeof(vl.type));
static kstat_io_t kio;
if (kc == NULL)
- return (-1);
+ return -1;
if (numtape <= 0)
- return (-1);
+ return -1;
for (int i = 0; i < numtape; i++) {
if (kstat_read(kc, ksp[i], &kio) == -1)
}
}
- return (0);
+ return 0;
}
void module_register(void) {