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 #1856 from rubenk/snmp-dont-dispatch-values-with-empty-type-instance
[collectd.git]
/
src
/
sensors.c
diff --git
a/src/sensors.c
b/src/sensors.c
index
63a1c8e
..
de2a4f7
100644
(file)
--- a/
src/sensors.c
+++ b/
src/sensors.c
@@
-34,6
+34,7
@@
**/
#include "collectd.h"
**/
#include "collectd.h"
+
#include "common.h"
#include "plugin.h"
#include "configfile.h"
#include "common.h"
#include "plugin.h"
#include "configfile.h"
@@
-215,11
+216,9
@@
static int sensors_snprintf_chip_name (char *buf, size_t buf_size,
static int sensors_feature_name_to_type (const char *name)
{
static int sensors_feature_name_to_type (const char *name)
{
- int i;
-
/* Yes, this is slow, but it's only ever done during initialization, so
* it's a one time cost.. */
/* Yes, this is slow, but it's only ever done during initialization, so
* it's a one time cost.. */
- for (i = 0; i < known_features_num; i++)
+ for (i
nt i
= 0; i < known_features_num; i++)
if (strcasecmp (known_features[i].label, name) == 0)
return (known_features[i].type);
if (strcasecmp (known_features[i].label, name) == 0)
return (known_features[i].type);
@@
-275,7
+274,6
@@
static int sensors_config (const char *key, const char *value)
static void sensors_free_features (void)
{
static void sensors_free_features (void)
{
- featurelist_t *thisft;
featurelist_t *nextft;
if (first_feature == NULL)
featurelist_t *nextft;
if (first_feature == NULL)
@@
-283,7
+281,7
@@
static void sensors_free_features (void)
sensors_cleanup ();
sensors_cleanup ();
- for (thisft = first_feature; thisft != NULL; thisft = nextft)
+ for (
featurelist_t *
thisft = first_feature; thisft != NULL; thisft = nextft)
{
nextft = thisft->next;
sfree (thisft);
{
nextft = thisft->next;
sfree (thisft);
@@
-521,13
+519,11
@@
static void sensors_submit (const char *plugin_instance,
static int sensors_read (void)
{
static int sensors_read (void)
{
- featurelist_t *fl;
-
if (sensors_load_conf () != 0)
return (-1);
#if SENSORS_API_VERSION < 0x400
if (sensors_load_conf () != 0)
return (-1);
#if SENSORS_API_VERSION < 0x400
- for (fl = first_feature; fl != NULL; fl = fl->next)
+ for (f
eaturelist_t *f
l = first_feature; fl != NULL; fl = fl->next)
{
double value;
int status;
{
double value;
int status;
@@
-555,7
+551,7
@@
static int sensors_read (void)
/* #endif SENSORS_API_VERSION < 0x400 */
#elif (SENSORS_API_VERSION >= 0x400) && (SENSORS_API_VERSION < 0x500)
/* #endif SENSORS_API_VERSION < 0x400 */
#elif (SENSORS_API_VERSION >= 0x400) && (SENSORS_API_VERSION < 0x500)
- for (fl = first_feature; fl != NULL; fl = fl->next)
+ for (f
eaturelist_t *f
l = first_feature; fl != NULL; fl = fl->next)
{
double value;
int status;
{
double value;
int status;