* [PATCH] meshctl: Retry recvmsg if data is not ready, else return error
@ 2019-05-16 9:20 Steve Brown
0 siblings, 0 replies; only message in thread
From: Steve Brown @ 2019-05-16 9:20 UTC (permalink / raw)
To: linux-bluetooth; +Cc: luiz.dentz, Steve Brown
---
tools/mesh/gatt.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/tools/mesh/gatt.c b/tools/mesh/gatt.c
index 2269a20cf..0a942d4eb 100644
--- a/tools/mesh/gatt.c
+++ b/tools/mesh/gatt.c
@@ -415,8 +415,11 @@ static bool sock_read(struct io *io, bool prov, void *user_data)
msg.msg_iovlen = 1;
while ((len = recvmsg(fd, &msg, MSG_DONTWAIT))) {
- if (len <= 0)
+ if (len <= 0) {
+ if (errno == EAGAIN)
+ break;
return false;
+ }
res = buf;
len_sar = mesh_gatt_sar(&res, len);
--
2.20.1
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2019-05-16 9:21 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-16 9:20 [PATCH] meshctl: Retry recvmsg if data is not ready, else return error Steve Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).