projects
/
collectd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'st/python'
[collectd.git]
/
src
/
disk.c
diff --git
a/src/disk.c
b/src/disk.c
index
c5a0cc8
..
94257fe
100644
(file)
--- a/
src/disk.c
+++ b/
src/disk.c
@@
-132,9
+132,7
@@
static int disk_config (const char *key, const char *value)
else if (strcasecmp ("IgnoreSelected", key) == 0)
{
int invert = 1;
else if (strcasecmp ("IgnoreSelected", key) == 0)
{
int invert = 1;
- if ((strcasecmp ("True", value) == 0)
- || (strcasecmp ("Yes", value) == 0)
- || (strcasecmp ("On", value) == 0))
+ if (IS_TRUE (value))
invert = 0;
ignorelist_set_invert (ignorelist, invert);
}
invert = 0;
ignorelist_set_invert (ignorelist, invert);
}
@@
-150,7
+148,7
@@
static int disk_init (void)
{
#if HAVE_IOKIT_IOKITLIB_H
kern_return_t status;
{
#if HAVE_IOKIT_IOKITLIB_H
kern_return_t status;
-
+
if (io_master_port != MACH_PORT_NULL)
{
mach_port_deallocate (mach_task_self (),
if (io_master_port != MACH_PORT_NULL)
{
mach_port_deallocate (mach_task_self (),
@@
-212,9
+210,8
@@
static void disk_submit (const char *plugin_instance,
vl.values = values;
vl.values_len = 2;
vl.values = values;
vl.values_len = 2;
- vl.time = time (NULL);
- strcpy (vl.host, hostname_g);
- strcpy (vl.plugin, "disk");
+ sstrncpy (vl.host, hostname_g, sizeof (vl.host));
+ sstrncpy (vl.plugin, "disk", sizeof (vl.plugin));
sstrncpy (vl.plugin_instance, plugin_instance,
sizeof (vl.plugin_instance));
sstrncpy (vl.type, type, sizeof (vl.type));
sstrncpy (vl.plugin_instance, plugin_instance,
sizeof (vl.plugin_instance));
sstrncpy (vl.type, type, sizeof (vl.type));
@@
-454,7
+451,7
@@
static int disk_read (void)
major = atoll (fields[0]);
minor = atoll (fields[1]);
major = atoll (fields[0]);
minor = atoll (fields[1]);
- disk_name = fields[2];
+ disk_name = fields[2
+ fieldshift
];
for (ds = disklist, pre_ds = disklist; ds != NULL; pre_ds = ds, ds = ds->next)
if (strcmp (disk_name, ds->name) == 0)
for (ds = disklist, pre_ds = disklist; ds != NULL; pre_ds = ds, ds = ds->next)
if (strcmp (disk_name, ds->name) == 0)