Fix fail to detect keyboard backlight when initial value is zero

Richard Hughes hughsient at gmail.com
Mon Oct 18 03:07:51 PDT 2010


On 18 October 2010 10:00, Alex Murray <murray.alex at gmail.com> wrote:
> See attached patch - basically if the kbd backlight is zero at startup
> upower will currently fail to detect it since it sees a value of 0 as
> an error - instead don't bother to check for error since
> g_ascii_strtoll returns 0 as both error and a valid conversion of 0.

Look at the docs for g_ascii_strtoull -- there's a way to detect if
parsing failed by comparing the two pointers. I think that's a much
better fix.

Richard.


More information about the devkit-devel mailing list