Skip to contentSkip to conversation

meshctl: Retry recvmsg if data is not ready, else return error

PATCH Superseded Steve Brown 1 participant 1 message May 16, 2019 Bluetooth drivers

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 meshctl: Retry recvmsg if data is not ready, else return error

---
 tools/mesh/gatt.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
tools/mesh/gatt.c +4 -1
index 2269a20cf..0a942d4eb 100644
@@ -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);
Signature · 1 line
2.20.1