From 4b6f9ee7276b596922d89619dd0b20d248344d7f Mon Sep 17 00:00:00 2001 From: Jean Delvare Date: Sun, 23 Sep 2007 13:48:52 +0000 Subject: [PATCH] Better error message if configuration file can't be loaded. git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4853 7894878c-1315-0410-8ee3-d5d059ff63e0 --- prog/sensord/lib.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/prog/sensord/lib.c b/prog/sensord/lib.c index d5459d63..9e47e871 100644 --- a/prog/sensord/lib.c +++ b/prog/sensord/lib.c @@ -79,10 +79,8 @@ loadConfig if (!strcmp (cfgPath, "-")) { if (!reload) { if ((ret = sensors_init (stdin))) { - if (ret == -SENSORS_ERR_PROC) - sensorLog (LOG_ERR, "Error reading /proc or /sys; modules probably not loaded"); - else - sensorLog (LOG_ERR, "Error %d loading sensors configuration file: ", ret); + sensorLog (LOG_ERR, "Error loading sensors configuration file : %s", + sensors_strerror (ret)); ret = 12; } } @@ -98,10 +96,8 @@ loadConfig sensorLog (LOG_ERR, "Error opening sensors configuration file: %s", cfgPath); ret = 11; } else if ((ret = sensors_init (cfg))) { - if (ret == -SENSORS_ERR_PROC) - sensorLog (LOG_ERR, "Error reading /proc or /sys; modules probably not loaded"); - else - sensorLog (LOG_ERR, "Error %d loading sensors configuration file: %s", ret, cfgPath); + sensorLog (LOG_ERR, "Error loading sensors configuration file %s: %s", + cfgPath, sensors_strerror (ret)); ret = 11; } else { cfgLastModified = stats.st_mtime;