diff options
author | Radek Novacek <rnovacek@redhat.com> | 2012-07-27 09:35:03 +0200 |
---|---|---|
committer | Radek Novacek <rnovacek@redhat.com> | 2012-07-27 09:35:03 +0200 |
commit | 171113535983029ab395341c8f8f3c92f320ea1a (patch) | |
tree | 2e7f2f064d29804666465166c114aa7f7845e134 /src/fan | |
parent | 99b6e54a64d962d226679ca290117f114eaf8245 (diff) | |
download | openlmi-providers-171113535983029ab395341c8f8f3c92f320ea1a.tar.gz openlmi-providers-171113535983029ab395341c8f8f3c92f320ea1a.tar.xz openlmi-providers-171113535983029ab395341c8f8f3c92f320ea1a.zip |
Unify logging through all providers
Needs to be ported to sfcb/pegasus standard logging, using stderr for
now.
Diffstat (limited to 'src/fan')
-rw-r--r-- | src/fan/Linux_Fan.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/src/fan/Linux_Fan.c b/src/fan/Linux_Fan.c index 738920b..9826ba2 100644 --- a/src/fan/Linux_Fan.c +++ b/src/fan/Linux_Fan.c @@ -14,10 +14,6 @@ * along with cmpiLinux_FanProvider. If not, see * <http://www.gnu.org/licenses/>. */ -#ifndef _XOPEN_SOURCE - //this is for strdup - #define _XOPEN_SOURCE 500 -#endif #include <stdlib.h> #include <stdio.h> #include <string.h> @@ -28,6 +24,7 @@ #include <sensors/error.h> #include "Linux_Fan.h" +#include "globals.h" #define MAX_CHIP_NAME_LENGTH 200 @@ -108,13 +105,13 @@ static cim_fan_error_t reload_config_file(char const * fp) { if (fp) { if (!(config_file = fopen(fp, "r"))) { - fprintf(stderr, "Cound not open config file \"%s\": %s\n", + error("Cound not open config file \"%s\": %s\n", fp, strerror(errno)); } } err = sensors_init(config_file); if (err) { - fprintf(stderr, "sensors_init: %s\n", sensors_strerror(err)); + error("sensors_init: %s\n", sensors_strerror(err)); if (config_file) fclose(config_file); }else { if (config_file) fclose(config_file); @@ -245,7 +242,7 @@ static struct cim_fan * _load_fan_data( sensors_chip_name const *chip if ((f = calloc(1, sizeof(struct cim_fan)))) { if (!(chip_name = sprintf_chip_name(chip))) { - fprintf(stderr, "could not get chip name\n"); + error("could not get chip name\n"); goto lab_err_free_fan; } if (!(f->chip_name = strdup(chip_name))) { @@ -254,7 +251,7 @@ static struct cim_fan * _load_fan_data( sensors_chip_name const *chip } f->sys_path = chip->path; if (!(f->name = sensors_get_label(chip, feature))) { - fprintf(stderr, "could not get fan name for chip: %s\n", + error("could not get fan name for chip: %s\n", f->chip_name); goto lab_err_chip_name; } |