* [PATCH] sensord: wrong error message with /proc or /sys not
@ 2005-05-19 6:25 Aurelien Jarno
2005-05-19 6:25 ` Jean Delvare
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Aurelien Jarno @ 2005-05-19 6:25 UTC (permalink / raw)
To: lm-sensors
Hi all,
There is currently a bug in sensord, which causes it to print the
following message if /proc files are not accessible:
Error -4 loading sensors configuration file: /etc/sensors.conf
Not really an explicit message :)
It should instead print the following message.
Error reading /proc; modules probably not loaded
The problem is that the library returns a negative number if there is an
error, and the error numbers in the .h files are not negative. Thus one
of the operand of the comparison should be negated. Patch to fix that is
attached.
BTW, on 2.6 kernels the sensors informations are in /sys and not /proc.
The message may be changed into:
Error reading /proc or /sys; modules probably not loaded
Bye,
Aur?lien
--
.''`. Aurelien Jarno GPG: 1024D/F1BCDB73
: :' : Debian GNU/Linux developer | Electrical Engineer
`. `' aurel32@debian.org | aurelien@aurel32.net
`- people.debian.org/~aurel32 | www.aurel32.net
-------------- next part --------------
Index: prog/sensord/lib.c
=================================RCS file: /home/cvs/lm_sensors2/prog/sensord/lib.c,v
retrieving revision 1.4
diff -u -1 -b -p -r1.4 lib.c
--- prog/sensord/lib.c 31 Jul 2002 14:27:49 -0000 1.4
+++ prog/sensord/lib.c 5 Jan 2005 21:22:07 -0000
@@ -81,3 +81,3 @@ loadConfig
if ((ret = sensors_init (stdin))) {
- if (ret = SENSORS_ERR_PROC)
+ if (ret = -SENSORS_ERR_PROC)
sensorLog (LOG_ERR, "Error reading /proc; modules probably not loaded");
@@ -98,3 +98,3 @@ loadConfig
} else if ((ret = sensors_init (cfg))) {
- if (ret = SENSORS_ERR_PROC)
+ if (ret = -SENSORS_ERR_PROC)
sensorLog (LOG_ERR, "Error reading /proc; modules probably not loaded");
^ permalink raw reply [flat|nested] 4+ messages in thread* [PATCH] sensord: wrong error message with /proc or /sys not
2005-05-19 6:25 [PATCH] sensord: wrong error message with /proc or /sys not Aurelien Jarno
@ 2005-05-19 6:25 ` Jean Delvare
2005-05-19 6:25 ` Aurelien Jarno
2005-05-19 6:25 ` Jean Delvare
2 siblings, 0 replies; 4+ messages in thread
From: Jean Delvare @ 2005-05-19 6:25 UTC (permalink / raw)
To: lm-sensors
> > True. I would certainly accept a patch that does this ;)
>
> Attached.
Applied, thanks.
--
Jean Delvare
http://khali.linux-fr.org/
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH] sensord: wrong error message with /proc or /sys not
2005-05-19 6:25 [PATCH] sensord: wrong error message with /proc or /sys not Aurelien Jarno
2005-05-19 6:25 ` Jean Delvare
@ 2005-05-19 6:25 ` Aurelien Jarno
2005-05-19 6:25 ` Jean Delvare
2 siblings, 0 replies; 4+ messages in thread
From: Aurelien Jarno @ 2005-05-19 6:25 UTC (permalink / raw)
To: lm-sensors
On Wed, Jan 05, 2005 at 10:39:49PM +0100, Jean Delvare wrote:
> > BTW, on 2.6 kernels the sensors informations are in /sys and not
> > /proc. The message may be changed into:
> >
> > Error reading /proc or /sys; modules probably not loaded
>
> True. I would certainly accept a patch that does this ;)
Attached.
--
.''`. Aurelien Jarno GPG: 1024D/F1BCDB73
: :' : Debian GNU/Linux developer | Electrical Engineer
`. `' aurel32@debian.org | aurelien@aurel32.net
`- people.debian.org/~aurel32 | www.aurel32.net
-------------- next part --------------
Index: prog/sensord/lib.c
=================================RCS file: /home/cvs/lm_sensors2/prog/sensord/lib.c,v
retrieving revision 1.5
diff -u -1 -b -p -r1.5 lib.c
--- prog/sensord/lib.c 5 Jan 2005 21:44:57 -0000 1.5
+++ prog/sensord/lib.c 5 Jan 2005 22:10:15 -0000
@@ -82,3 +82,3 @@ loadConfig
if (ret = -SENSORS_ERR_PROC)
- sensorLog (LOG_ERR, "Error reading /proc; modules probably not loaded");
+ sensorLog (LOG_ERR, "Error reading /proc or /sys; modules probably not loaded");
else
@@ -99,3 +99,3 @@ loadConfig
if (ret = -SENSORS_ERR_PROC)
- sensorLog (LOG_ERR, "Error reading /proc; modules probably not loaded");
+ sensorLog (LOG_ERR, "Error reading /proc or /sys; modules probably not loaded");
else
^ permalink raw reply [flat|nested] 4+ messages in thread* [PATCH] sensord: wrong error message with /proc or /sys not
2005-05-19 6:25 [PATCH] sensord: wrong error message with /proc or /sys not Aurelien Jarno
2005-05-19 6:25 ` Jean Delvare
2005-05-19 6:25 ` Aurelien Jarno
@ 2005-05-19 6:25 ` Jean Delvare
2 siblings, 0 replies; 4+ messages in thread
From: Jean Delvare @ 2005-05-19 6:25 UTC (permalink / raw)
To: lm-sensors
> The problem is that the library returns a negative number if there is
> an error, and the error numbers in the .h files are not negative. Thus
> one of the operand of the comparison should be negated. Patch to fix
> that is attached.
Applied, thanks.
> BTW, on 2.6 kernels the sensors informations are in /sys and not
> /proc. The message may be changed into:
>
> Error reading /proc or /sys; modules probably not loaded
True. I would certainly accept a patch that does this ;)
--
Jean Delvare
http://khali.linux-fr.org/
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2005-05-19 6:25 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-05-19 6:25 [PATCH] sensord: wrong error message with /proc or /sys not Aurelien Jarno
2005-05-19 6:25 ` Jean Delvare
2005-05-19 6:25 ` Aurelien Jarno
2005-05-19 6:25 ` Jean Delvare
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.