Christopher N. Hesse
e37aedde2e
lights: Put back fd checks before closing
...
While close(NULL) is indeed a harmless noop, fd can
end up being < 0 for us.
Change-Id: I56dcd7fb61c72d3ce750b13329ff42e11ab63c84
8 years ago
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
8 years ago
Christopher N. Hesse
f154b17b79
lights: Add a log tag
...
Change-Id: I7f4643324ed5c52b60ceede5f1ad8f24131cf3c0
8 years ago
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
8 years ago
Christopher N. Hesse
b5b9500a62
lights: Remove superfluous log newlines
...
Change-Id: Id1522dfe92c9e585000edd7067b50968f38c07ca
8 years ago
Christopher N. Hesse
898e1fe432
liblights: Expose panel brightness in helper lib
...
Change-Id: I810166818eac84466dfe2c4b88dff47e83a181c0
8 years ago