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 | 477abd91e5f174a548e30a5f38beb7a8b14ff437 (patch) | |
tree | 6913b0273dac5d6ab7ff1f061f48a8dcf1579c17 /libsensors/sensors.cpp | |
parent | 39fb2961a2f5a717347308dda394038b67556938 (diff) | |
download | device_samsung_tuna-477abd91e5f174a548e30a5f38beb7a8b14ff437.zip device_samsung_tuna-477abd91e5f174a548e30a5f38beb7a8b14ff437.tar.gz device_samsung_tuna-477abd91e5f174a548e30a5f38beb7a8b14ff437.tar.bz2 |
sensors: Retry poll on EINTR
Change-Id: I29dec0d901ce56b385d03e24d354b1f3d2b13776
Diffstat (limited to 'libsensors/sensors.cpp')
-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; |