summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 3603182)
raw | patch | inline | side by side (parent: 3603182)
author | Florian Forster <octo@huhu.verplant.org> | |
Tue, 22 May 2007 09:44:51 +0000 (11:44 +0200) | ||
committer | Florian Forster <octo@huhu.verplant.org> | |
Tue, 22 May 2007 09:44:51 +0000 (11:44 +0200) |
..so it gets suspended as it should be.
src/sensors.c | patch | blob | history |
diff --git a/src/sensors.c b/src/sensors.c
index 6ed8ddd32c034efddbbff42929c6bba74e540e61..e1bc7aafc2100ef2341b990ed7ad9352e2783c30 100644 (file)
--- a/src/sensors.c
+++ b/src/sensors.c
first_feature = NULL;
}
-static void sensors_load_conf (void)
+static int sensors_load_conf (void)
{
FILE *fh;
featurelist_t *last_feature = NULL;
if ((sensors_config_mtime != 0)
&& (sensors_config_mtime == statbuf.st_mtime))
- return;
+ return (0);
if (sensors_config_mtime != 0)
{
char errbuf[1024];
ERROR ("sensors plugin: fopen(%s) failed: %s", conffile,
sstrerror (errno, errbuf, sizeof (errbuf)));
- return;
+ return (-1);
}
status = sensors_init (fh);
{
ERROR ("sensors plugin: Cannot initialize sensors. "
"Data will not be collected.");
- return;
+ return (-1);
}
sensors_config_mtime = statbuf.st_mtime;
sensors_cleanup ();
INFO ("sensors plugin: lm_sensors reports no "
"features. Data will not be collected.");
+ return (-1);
}
-} /* void sensors_load_conf */
+
+ return (0);
+} /* int sensors_load_conf */
static int sensors_shutdown (void)
{
char plugin_instance[DATA_MAX_NAME_LEN];
char type_instance[DATA_MAX_NAME_LEN];
- sensors_load_conf ();
+ if (sensors_load_conf () != 0)
+ return (-1);
for (feature = first_feature; feature != NULL; feature = feature->next)
{