Re: [PATCH] fancontrol: syslog flooded by error messages.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Rodrigo,

Le Monday 04 May 2015 à 12:37 -0300, Rodrigo Wezher a écrit :
> There is an error at this line:
> http://lm-sensors.org/browser/lm-sensors/trunk/prog/pwm/fancontrol?rev=6255#L544
> 
> Bug reported at:
> https://launchpad.net/~debianbug

I guess you actually meant:

https://bugs.launchpad.net/ubuntu/+source/lm-sensors-3/+bug/1405784

> 
> Fix by: Mac_Weber
> 
> Replace:
> if [ $pwmpval -eq 0 -o $min_fanval -eq 0 ]

This is arguably fragile but...

> By:
> if [ "${pwmpval} -eq 0 -o ${min_fanval} -eq 0" ]

... this is plain wrong: the condition will always be true regardless of
the value of $pwmpval and $min_fanval.

if [ "$pwmpval" -eq 0 -o "$min_fanval" -eq 0 ]

would be correct and somewhat more robust, however if the current syntax
causes an error this suggests that either pwmpval or min_fanval isn't
set to a number, and the syntax above will still print an error in that
case.

> Without this fix the file /var/log/syslog gets flooded by error messages.

With the proposed "fix", the script would misbehave.

The actual bug is already fixed anyway:

http://lm-sensors.org/changeset/6255

as pointed out by the last comment of the launchpad bug report.

-- 
Jean Delvare
SUSE L3 Support


_______________________________________________
lm-sensors mailing list
lm-sensors@xxxxxxxxxxxxxx
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors





[Index of Archives]     [Linux Kernel]     [Linux Hardware Monitoring]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux