/*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: 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));
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;
__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));
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));