X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=btif%2Fco%2Fbta_hh_co.c;h=92a471a21035e7c09b6dc2421b00a98e744de920;hb=f9a4d9e8bf63b006bec9c30f6dc430ac5d30a85b;hp=bd6fd6f061287adfd211da2454193feb2811326f;hpb=c7cb8f0715263404ab78f864933567e5e870ab49;p=android-x86%2Fsystem-bt.git diff --git a/btif/co/bta_hh_co.c b/btif/co/bta_hh_co.c index bd6fd6f06..92a471a21 100644 --- a/btif/co/bta_hh_co.c +++ b/btif/co/bta_hh_co.c @@ -29,6 +29,7 @@ #include #include #include +#include "osi/include/osi.h" #include "btif_hh.h" #include "bta_api.h" #include "bta_hh_api.h" @@ -58,8 +59,9 @@ 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; + OSI_NO_INTR(ret = write(fd, ev, sizeof(*ev))); if (ret < 0){ int rtn = -errno; APPL_TRACE_ERROR("%s: Cannot write to uhid:%s", @@ -197,7 +199,6 @@ static void *btif_hh_poll_event_thread(void *arg) btif_hh_device_t *p_dev = arg; APPL_TRACE_DEBUG("%s: Thread created fd = %d", __FUNCTION__, p_dev->fd); struct pollfd pfds[1]; - int ret; pfds[0].fd = p_dev->fd; pfds[0].events = POLLIN; @@ -206,7 +207,8 @@ 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); + int ret; + OSI_NO_INTR(ret = poll(pfds, 1, 50)); if (ret < 0) { APPL_TRACE_ERROR("%s: Cannot poll for fds: %s\n", __FUNCTION__, strerror(errno)); break;