projects
/
collectd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
contrib/docker: add LD_PRELOAD wrapper to fopen/open/opendir syscalls
[collectd.git]
/
src
/
apple_sensors.c
diff --git
a/src/apple_sensors.c
b/src/apple_sensors.c
index
1c72dda
..
17c822f
100644
(file)
--- a/
src/apple_sensors.c
+++ b/
src/apple_sensors.c
@@
-83,19
+83,11
@@
static int as_init (void)
static void as_submit (const char *type, const char *type_instance,
double val)
{
static void as_submit (const char *type, const char *type_instance,
double val)
{
- value_t values[1];
value_list_t vl = VALUE_LIST_INIT;
value_list_t vl = VALUE_LIST_INIT;
- DEBUG ("type = %s; type_instance = %s; val = %f;",
- type, type_instance, val);
-
- values[0].gauge = val;
-
- vl.values = values;
+ vl.values = &(value_t) { .gauge = val };
vl.values_len = 1;
vl.values_len = 1;
- sstrncpy (vl.host, hostname_g, sizeof (vl.host));
sstrncpy (vl.plugin, "apple_sensors", sizeof (vl.plugin));
sstrncpy (vl.plugin, "apple_sensors", sizeof (vl.plugin));
- sstrncpy (vl.plugin_instance, "", sizeof (vl.plugin_instance));
sstrncpy (vl.type, type, sizeof (vl.type));
sstrncpy (vl.type_instance, type_instance, sizeof (vl.type_instance));
sstrncpy (vl.type, type, sizeof (vl.type));
sstrncpy (vl.type_instance, type_instance, sizeof (vl.type_instance));
@@
-114,8
+106,6
@@
static int as_read (void)
char inst[128];
int value_int;
double value_double;
char inst[128];
int value_int;
double value_double;
- int i;
-
if (!io_master_port || (io_master_port == MACH_PORT_NULL))
return (-1);
if (!io_master_port || (io_master_port == MACH_PORT_NULL))
return (-1);
@@
-170,7
+160,7
@@
static int as_read (void)
kCFStringEncodingASCII))
continue;
inst[sizeof (inst) - 1] = '\0';
kCFStringEncodingASCII))
continue;
inst[sizeof (inst) - 1] = '\0';
- for (i = 0; i < 128; i++)
+ for (i
nt i
= 0; i < 128; i++)
{
if (inst[i] == '\0')
break;
{
if (inst[i] == '\0')
break;