diff options
author | Arve Hjønnevåg <arve@android.com> | 2011-11-08 21:00:08 -0800 |
---|---|---|
committer | Arve Hjønnevåg <arve@android.com> | 2011-11-09 15:34:37 -0800 |
commit | a0b9e472a70f4e380bfe06a25a44fb1242bf94ef (patch) | |
tree | d3e51c231f73417cbb447782fdfeeb35533208a6 /libsensors | |
parent | 659ecd73598715ec4e901dee72557efaac8f12c9 (diff) | |
download | device_samsung_tuna-a0b9e472a70f4e380bfe06a25a44fb1242bf94ef.zip device_samsung_tuna-a0b9e472a70f4e380bfe06a25a44fb1242bf94ef.tar.gz device_samsung_tuna-a0b9e472a70f4e380bfe06a25a44fb1242bf94ef.tar.bz2 |
sensors: Retry poll on EINTR
Change-Id: I29dec0d901ce56b385d03e24d354b1f3d2b13776
Diffstat (limited to 'libsensors')
-rw-r--r-- | libsensors/sensors.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/libsensors/sensors.cpp b/libsensors/sensors.cpp index 450dbd5..57b1aa8 100644 --- a/libsensors/sensors.cpp +++ b/libsensors/sensors.cpp @@ -302,7 +302,9 @@ int sensors_poll_context_t::pollEvents(sensors_event_t* data, int count) // anything to return int i; - n = poll(mPollFds, numFds, nbEvents ? 0 : polltime); + do { + n = poll(mPollFds, numFds, nbEvents ? 0 : polltime); + } while (n < 0 && errno == EINTR); if (n<0) { LOGE("poll() failed (%s)", strerror(errno)); return -errno; |