summaryrefslogtreecommitdiffstats
path: root/btif/co/bta_hh_co.c
diff options
context:
space:
mode:
Diffstat (limited to 'btif/co/bta_hh_co.c')
-rw-r--r--btif/co/bta_hh_co.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/btif/co/bta_hh_co.c b/btif/co/bta_hh_co.c
index 465708b6f..b28b24b2a 100644
--- a/btif/co/bta_hh_co.c
+++ b/btif/co/bta_hh_co.c
@@ -184,8 +184,7 @@ void uhid_set_non_blocking(int fd)
/*Internal function to perform UHID write and error checking*/
static int uhid_write(int fd, const struct uhid_event *ev)
{
- ssize_t ret = write(fd, ev, sizeof(*ev));
-
+ ssize_t ret = TEMP_FAILURE_RETRY(write(fd, ev, sizeof(*ev)));
if (ret < 0){
int rtn = -errno;
APPL_TRACE_ERROR("%s: Cannot write to uhid:%s",
@@ -211,7 +210,7 @@ static int uhid_event(btif_hh_device_t *p_dev)
APPL_TRACE_ERROR("%s: Device not found",__FUNCTION__)
return -1;
}
- ret = read(p_dev->fd, &ev, sizeof(ev));
+ ret = TEMP_FAILURE_RETRY(read(p_dev->fd, &ev, sizeof(ev)));
if (ret == 0) {
APPL_TRACE_ERROR("%s: Read HUP on uhid-cdev %s", __FUNCTION__,
strerror(errno));
@@ -366,7 +365,7 @@ static void *btif_hh_poll_event_thread(void *arg)
uhid_set_non_blocking(p_dev->fd);
while(p_dev->hh_keep_polling){
- ret = poll(pfds, 1, 50);
+ ret = TEMP_FAILURE_RETRY(poll(pfds, 1, 50));
if (ret < 0) {
APPL_TRACE_ERROR("%s: Cannot poll for fds: %s\n", __FUNCTION__, strerror(errno));
break;
@@ -460,7 +459,7 @@ void bta_hh_co_open(UINT8 dev_handle, UINT8 sub_class, tBTA_HH_ATTR_MASK attr_ma
__FUNCTION__, p_dev->attr_mask, p_dev->sub_class, p_dev->app_id);
if(p_dev->fd<0) {
- p_dev->fd = open(dev_path, O_RDWR | O_CLOEXEC);
+ p_dev->fd = TEMP_FAILURE_RETRY(open(dev_path, O_RDWR | O_CLOEXEC));
if (p_dev->fd < 0){
APPL_TRACE_ERROR("%s: Error: failed to open uhid, err:%s",
__FUNCTION__,strerror(errno));
@@ -489,7 +488,7 @@ void bta_hh_co_open(UINT8 dev_handle, UINT8 sub_class, tBTA_HH_ATTR_MASK attr_ma
btif_hh_cb.device_num++;
// This is a new device,open the uhid driver now.
- p_dev->fd = open(dev_path, O_RDWR | O_CLOEXEC);
+ p_dev->fd = TEMP_FAILURE_RETRY(open(dev_path, O_RDWR | O_CLOEXEC));
if (p_dev->fd < 0){
APPL_TRACE_ERROR("%s: Error: failed to open uhid, err:%s",
__FUNCTION__,strerror(errno));