From c26b22cacd9d582733758476a02ede58380b1153 Mon Sep 17 00:00:00 2001 From: Flavio Ceolin Date: Thu, 10 Sep 2015 18:10:17 -0300 Subject: [PATCH] network:linux: Handle EINTR error Keep monitoring the file descriptor in case of receiving EINTR. Also, as EWOULDBLOCK and EAGAIN are the same in linux (and this is linux specific code) just checking for one of them. Signed-off-by: Flavio Ceolin --- src/lib/comms/sol-network-linux.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/lib/comms/sol-network-linux.c b/src/lib/comms/sol-network-linux.c index d973fe3a3..0fc9007de 100644 --- a/src/lib/comms/sol-network-linux.c +++ b/src/lib/comms/sol-network-linux.c @@ -238,9 +238,12 @@ _on_event(void *data, int nl_socket, unsigned int cond) while ((status = recvmsg(nl_socket, &msg, MSG_WAITALL))) { if (status < 0) { - if (errno == EWOULDBLOCK || errno == EAGAIN) + if (errno == EAGAIN) return true; + if (errno == EINTR) + continue; + SOL_WRN("Read netlink error"); return false; }