Christopher N. Hesse
235c298767
lights_helper: I/O API cleanup
...
* buf => buffer for consistency
* explicitly cast strtol retval to int
* close(NULL) is a no-op, remove superfluous checking
* replace variying buffer sizes by INT_MAX_STRLEN
* always return signed errno codes
Change-Id: I972e33e2435ec7d68a8ffdc5ab88a14d8005ff55
2017-04-02 17:27:58 +02:00
Christopher N. Hesse
f154b17b79
lights: Add a log tag
...
Change-Id: I7f4643324ed5c52b60ceede5f1ad8f24131cf3c0
2017-03-04 16:03:33 +01:00
Christopher N. Hesse
209f5deec3
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
2017-03-04 15:42:49 +01:00
Christopher N. Hesse
b5b9500a62
lights: Remove superfluous log newlines
...
Change-Id: Id1522dfe92c9e585000edd7067b50968f38c07ca
2017-03-04 15:04:16 +01:00
Christopher N. Hesse
898e1fe432
liblights: Expose panel brightness in helper lib
...
Change-Id: I810166818eac84466dfe2c4b88dff47e83a181c0
2016-12-21 14:23:38 -08:00