summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartijn Coenen <maco@google.com>2016-06-13 10:44:00 +0200
committerMartijn Coenen <maco@google.com>2016-06-14 22:29:04 +0000
commit923afa2d760c1ea97f04f89c641ad6d32824e888 (patch)
treeed1d93625f20057ad584b76b02d2e7c73d623f90
parent5340dae86f4e2bb697cccd0f586501b52a784db5 (diff)
downloadlibnfc-nci-923afa2d760c1ea97f04f89c641ad6d32824e888.tar.gz
Bug: 28792238 Change-Id: Iaeb03a5be6d04cbc8dcf838ed7a0489d790e0028
-rw-r--r--halimpl/bcm2079x/adaptation/userial_linux.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/halimpl/bcm2079x/adaptation/userial_linux.c b/halimpl/bcm2079x/adaptation/userial_linux.c
index f41f296..f7ea94e 100644
--- a/halimpl/bcm2079x/adaptation/userial_linux.c
+++ b/halimpl/bcm2079x/adaptation/userial_linux.c
@@ -29,6 +29,7 @@
#include <fcntl.h>
#include <errno.h>
#include <stdio.h>
+#include <unistd.h>
#include <gki_int.h>
#include "hcidefs.h"
#include <poll.h>
@@ -633,7 +634,7 @@ int my_read(int fd, uchar *pbuf, int len)
fds[1].events = POLLIN | POLLERR | POLLRDNORM;
fds[1].revents = 0;
t1 = clock();
- n = poll(fds, 2, _timeout);
+ n = TEMP_FAILURE_RETRY(poll(fds, 2, _timeout));
t2 = clock();
perf_update(&perf_poll, t2 - t1, 0);
if (_poll_t0)
@@ -661,7 +662,7 @@ int my_read(int fd, uchar *pbuf, int len)
count = 1;
do {
t2 = clock();
- ret = read(fd, pbuf+offset, (size_t)count);
+ ret = TEMP_FAILURE_RETRY(read(fd, pbuf+offset, (size_t)count));
if (ret > 0)
perf_update(&perf_read, clock()-t2, ret);
@@ -1253,7 +1254,7 @@ UDRV_API UINT16 USERIAL_Write(tUSERIAL_PORT port, UINT8 *p_data, UINT16 len)
t = clock();
while (len != 0 && linux_cb.sock != -1)
{
- ret = write(linux_cb.sock, p_data + total, len);
+ ret = TEMP_FAILURE_RETRY(write(linux_cb.sock, p_data + total, len));
if (ret < 0)
{
ALOGE("USERIAL_Write len = %d, ret = %d, errno = %d", len, ret, errno);
@@ -1767,7 +1768,7 @@ static int change_client_addr(int addr)
/* always revert back to the default client address */
ioctl(linux_cb.sock, BCMNFC_SET_CLIENT_ADDR, DEFAULT_CLIENT_ADDRESS);
/* Send address change command (skipping first byte) */
- ret = write(linux_cb.sock, &addr_data[1], size);
+ ret = TEMP_FAILURE_RETRY(write(linux_cb.sock, &addr_data[1], size));
/* If it fails, it is likely a B3 we are talking to */
if (ret != size) {