Commit 1c5a2320 authored by Juliusz Chroboczek's avatar Juliusz Chroboczek

Work around recvmsg in netlink_read.

parent bb3e68ba
...@@ -193,7 +193,7 @@ netlink_read(struct netlink *nl, struct netlink *nl_ignore, int answer, ...@@ -193,7 +193,7 @@ netlink_read(struct netlink *nl, struct netlink *nl_ignore, int answer,
if(len < 0 && (errno == EAGAIN || errno == EINTR)) { if(len < 0 && (errno == EAGAIN || errno == EINTR)) {
int rc; int rc;
rc = wait_for_fd(0, nl->sock, 100); rc = wait_for_fd(0, nl->sock, 10);
if(rc <= 0) { if(rc <= 0) {
if(rc == 0) if(rc == 0)
errno = EAGAIN; errno = EAGAIN;
...@@ -203,7 +203,11 @@ netlink_read(struct netlink *nl, struct netlink *nl_ignore, int answer, ...@@ -203,7 +203,11 @@ netlink_read(struct netlink *nl, struct netlink *nl_ignore, int answer,
} }
if(len < 0) { if(len < 0) {
perror("netlink_read: recvmsg()"); if(errno == EAGAIN) {
done = 1;
break;
}
perror("netlink_read: recvmsg");
return 2; return 2;
} else if(len == 0) { } else if(len == 0) {
fprintf(stderr, "netlink_read: EOF\n"); fprintf(stderr, "netlink_read: EOF\n");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment