diff options
author | Ziyan <jaraidaniel@gmail.com> | 2016-02-24 21:03:01 +0100 |
---|---|---|
committer | Andreas Blaesius <skate4life@gmx.de> | 2016-02-26 11:36:50 -0800 |
commit | ddcb5b46e26b7f8ea2c984a8b94caf084541b882 (patch) | |
tree | 18d55112808a7f9120d2ccf31e4b0ab2fa0dcee2 | |
parent | 2f4436da12d93f1732b3677cbf769dc0bac36a3b (diff) | |
download | device_samsung_espressowifi-ddcb5b46e26b7f8ea2c984a8b94caf084541b882.zip device_samsung_espressowifi-ddcb5b46e26b7f8ea2c984a8b94caf084541b882.tar.gz device_samsung_espressowifi-ddcb5b46e26b7f8ea2c984a8b94caf084541b882.tar.bz2 |
libsensors: more robust sensor polling
Change-Id: I88efed34927c6911647084a3de6b61630468857f
-rw-r--r-- | libsensors/piranha_sensors.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/libsensors/piranha_sensors.c b/libsensors/piranha_sensors.c index eec9d68..c40f793 100644 --- a/libsensors/piranha_sensors.c +++ b/libsensors/piranha_sensors.c @@ -179,9 +179,13 @@ int piranha_sensors_poll(struct sensors_poll_device_t *dev, n = 0; do { - poll_rc = poll(device->poll_fds, device->poll_fds_count, n > 0 ? 0 : -1); - if (poll_rc < 0) - return -1; + do { + poll_rc = poll(device->poll_fds, device->poll_fds_count, n > 0 ? 0 : -1); + } while (poll_rc < 0 && errno == EINTR); + if (poll_rc < 0) { + ALOGE("poll() failed (%s)", strerror(errno)); + return -errno; + } for (i = 0; i < device->poll_fds_count; i++) { if (!(device->poll_fds[i].revents & POLLIN)) |