lights: Cleanup read/write API
authorChristopher N. Hesse <raymanfx@gmail.com>
Sat, 4 Mar 2017 14:16:56 +0000 (15:16 +0100)
committerChristopher N. Hesse <raymanfx@gmail.com>
Sat, 4 Mar 2017 14:42:49 +0000 (15:42 +0100)
commit209f5deec3ee7a9759f9c3d68218b2df6e119336
treed6082dfe372e5303cf493e9a8a9a5dcdbfbf5c05
parentb5b9500a62515b65725fa8f9b4b4428fd982e000
lights: Cleanup read/write API

 * Use O_WRONLY for write
 * Return errno for write
 * Log all failures
 * Fix read_int():
   We would always treat strtol(...) = 0 as an error,
   although the real value can very well be 0.
   Check the end pointer to fix this.

Change-Id: Id2bc9acc103a7a6400dd06f3904af37cbb0b5174
liblights/lights_helper.c