Skip to content
This repository has been archived by the owner on Jun 27, 2019. It is now read-only.

Commit

Permalink
network:linux: Handle EINTR error
Browse files Browse the repository at this point in the history
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 <flavio.ceolin@intel.com>
  • Loading branch information
ceolin committed Sep 11, 2015
1 parent 4d4ee81 commit c26b22c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/lib/comms/sol-network-linux.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit c26b22c

Please sign in to comment.