am 8a75ab5b: Merge "PAN TAP fd is not monitored in all cases" into lmp-mr1-dev
* commit '8a75ab5b918c4e65e1b8fe55ec193b047ddfcb06':
PAN TAP fd is not monitored in all cases
diff --git a/btif/src/btif_pan.c b/btif/src/btif_pan.c
index 32ae984..3d31bf5 100644
--- a/btif/src/btif_pan.c
+++ b/btif/src/btif_pan.c
@@ -703,10 +703,14 @@
case -1:
BTIF_TRACE_ERROR("%s unable to read from driver: %s", __func__, strerror(errno));
GKI_freebuf(buffer);
+ //add fd back to monitor thread to try it again later
+ btsock_thread_add_fd(pan_pth, fd, 0, SOCK_THREAD_FD_RD, 0);
return;
case 0:
BTIF_TRACE_WARNING("%s end of file reached.", __func__);
GKI_freebuf(buffer);
+ //add fd back to monitor thread to process the exception
+ btsock_thread_add_fd(pan_pth, fd, 0, SOCK_THREAD_FD_RD, 0);
return;
default:
btpan_cb.congest_packet_size = ret;
@@ -738,11 +742,11 @@
ufd.fd = fd;
ufd.events = POLLIN;
ufd.revents = 0;
- if(poll(&ufd, 1, 0) <= 0 || IS_EXCEPTION(ufd.revents)) {
- btsock_thread_add_fd(pan_pth, fd, 0, SOCK_THREAD_FD_RD, 0);
- return;
- }
+ if(poll(&ufd, 1, 0) <= 0 || IS_EXCEPTION(ufd.revents))
+ break;
}
+ //add fd back to monitor thread
+ btsock_thread_add_fd(pan_pth, fd, 0, SOCK_THREAD_FD_RD, 0);
}
static void btif_pan_close_all_conns() {