Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
halo
external_libnfc-nci
Commits
923afa2d
Commit
923afa2d
authored
8 years ago
by
Martijn Coenen
Browse files
Options
Download
Email Patches
Plain Diff
Retry system calls on EINTR.
Bug: 28792238 Change-Id: Iaeb03a5be6d04cbc8dcf838ed7a0489d790e0028
parent
5340dae8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
4 deletions
+5
-4
halimpl/bcm2079x/adaptation/userial_linux.c
halimpl/bcm2079x/adaptation/userial_linux.c
+5
-4
No files found.
halimpl/bcm2079x/adaptation/userial_linux.c
View file @
923afa2d
...
...
@@ -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
)
{
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment