X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fapple_sensors.c;h=48fbcb91e53117832fc26160df4f8ecd4fa96947;hb=4979d8dcd6f097eb8fd4661086e28accd31ff905;hp=19d5a49f31731ead712a4d78409bdd87b492007e;hpb=6a68a39a2c6987fdcc94fb1bdd9cc8f598fd9478;p=collectd.git diff --git a/src/apple_sensors.c b/src/apple_sensors.c index 19d5a49f..48fbcb91 100644 --- a/src/apple_sensors.c +++ b/src/apple_sensors.c @@ -25,6 +25,7 @@ **/ #include "collectd.h" + #include "common.h" #include "plugin.h" @@ -59,7 +60,7 @@ static mach_port_t io_master_port = MACH_PORT_NULL; static int as_init (void) { kern_return_t status; - + if (io_master_port != MACH_PORT_NULL) { mach_port_deallocate (mach_task_self (), @@ -113,8 +114,6 @@ static int as_read (void) char inst[128]; int value_int; double value_double; - int i; - if (!io_master_port || (io_master_port == MACH_PORT_NULL)) return (-1); @@ -169,7 +168,7 @@ static int as_read (void) kCFStringEncodingASCII)) continue; inst[sizeof (inst) - 1] = '\0'; - for (i = 0; i < 128; i++) + for (int i = 0; i < 128; i++) { if (inst[i] == '\0') break;