Skip to content

Commit 839734b

Browse files
Matthew XieAndroid (Google) Code Review
authored andcommitted
Merge "Handle ENITR failure for Headset control channel." into jb-dev
2 parents 0e44a6b + be513af commit 839734b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

core/jni/android_bluetooth_HeadsetBase.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ static const char* get_line(int fd, char *buf, int len, int timeout_ms,
115115
pfd.fd = fd;
116116
pfd.events = POLLIN;
117117
*err = errno = 0;
118-
int ret = poll(&pfd, 1, timeout_ms);
118+
int ret = TEMP_FAILURE_RETRY(poll(&pfd, 1, timeout_ms));
119119
if (ret < 0) {
120120
ALOGE("poll() error\n");
121121
*err = errno;
@@ -136,7 +136,7 @@ static const char* get_line(int fd, char *buf, int len, int timeout_ms,
136136
while ((int)(bufit - buf) < (len - 1))
137137
{
138138
errno = 0;
139-
int rc = read(fd, bufit, 1);
139+
int rc = TEMP_FAILURE_RETRY(read(fd, bufit, 1));
140140

141141
if (!rc)
142142
break;
@@ -427,7 +427,7 @@ static jint waitForAsyncConnectNative(JNIEnv *env, jobject obj,
427427
{
428428
char ch;
429429
errno = 0;
430-
int nr = read(nat->rfcomm_sock, &ch, 1);
430+
int nr = TEMP_FAILURE_RETRY(read(nat->rfcomm_sock, &ch, 1));
431431
/* It should be that nr != 1 because we just opened a socket
432432
and we haven't sent anything over it for the other side to
433433
respond... but one can't be paranoid enough.

0 commit comments

Comments
 (0)