summaryrefslogtreecommitdiffstats
path: root/core/jni
diff options
context:
space:
mode:
authorMatthew Xie <mattx@google.com>2012-06-14 20:08:40 -0700
committerMatthew Xie <mattx@google.com>2012-06-14 20:08:40 -0700
commitbe513afb62ad85b8beee310a2e6a0531eef97705 (patch)
treec1fecb21a9323b8571be2b7bbed99ba0c5fa0b7b /core/jni
parent0777558f0365d8020693109118bd92994b0ec8b1 (diff)
downloadframeworks_base-be513afb62ad85b8beee310a2e6a0531eef97705.zip
frameworks_base-be513afb62ad85b8beee310a2e6a0531eef97705.tar.gz
frameworks_base-be513afb62ad85b8beee310a2e6a0531eef97705.tar.bz2
Handle ENITR failure for Headset control channel.
Wrap poll and read with TEMP_FAILURE_RETRY bug 6503000, 6623444 Change-Id: I2e302dc04df6b5bd5982c3d189881a687a95fb2d
Diffstat (limited to 'core/jni')
-rw-r--r--core/jni/android_bluetooth_HeadsetBase.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/core/jni/android_bluetooth_HeadsetBase.cpp b/core/jni/android_bluetooth_HeadsetBase.cpp
index 0df211a..34447ef 100644
--- a/core/jni/android_bluetooth_HeadsetBase.cpp
+++ b/core/jni/android_bluetooth_HeadsetBase.cpp
@@ -115,7 +115,7 @@ again:
pfd.fd = fd;
pfd.events = POLLIN;
*err = errno = 0;
- int ret = poll(&pfd, 1, timeout_ms);
+ int ret = TEMP_FAILURE_RETRY(poll(&pfd, 1, timeout_ms));
if (ret < 0) {
ALOGE("poll() error\n");
*err = errno;
@@ -136,7 +136,7 @@ again:
while ((int)(bufit - buf) < (len - 1))
{
errno = 0;
- int rc = read(fd, bufit, 1);
+ int rc = TEMP_FAILURE_RETRY(read(fd, bufit, 1));
if (!rc)
break;
@@ -427,7 +427,7 @@ static jint waitForAsyncConnectNative(JNIEnv *env, jobject obj,
{
char ch;
errno = 0;
- int nr = read(nat->rfcomm_sock, &ch, 1);
+ int nr = TEMP_FAILURE_RETRY(read(nat->rfcomm_sock, &ch, 1));
/* It should be that nr != 1 because we just opened a socket
and we haven't sent anything over it for the other side to
respond... but one can't be paranoid enough.