@@ -196,8 +196,11 @@ int rtnl_dump_filter(struct rtnl_handle *rth,
status = recvmsg(rth->fd, &msg, 0);
if (status < 0) {
- if (errno == EINTR || errno == EAGAIN)
+ if (errno == EINTR || errno == EAGAIN) {
+ if (rth->fd < 0)
+ return 0;
continue;
+ }
fprintf(stderr, "netlink receive error %s (%d)\n",
strerror(errno), errno);
return -1;
@@ -300,8 +303,11 @@ int rtnl_talk(struct rtnl_handle *rtnl, struct nlmsghdr *n, pid_t peer,
status = recvmsg(rtnl->fd, &msg, 0);
if (status < 0) {
- if (errno == EINTR || errno == EAGAIN)
+ if (errno == EINTR || errno == EAGAIN) {
+ if (rtnl->fd < 0)
+ return 0;
continue;
+ }
fprintf(stderr, "netlink receive error %s (%d)\n",
strerror(errno), errno);
return -1;
@@ -405,8 +411,11 @@ int rtnl_listen(struct rtnl_handle *rtnl,
status = recvmsg(rtnl->fd, &msg, 0);
if (status < 0) {
- if (errno == EINTR || errno == EAGAIN)
+ if (errno == EINTR || errno == EAGAIN) {
+ if (rtnl->fd < 0)
+ return 0;
continue;
+ }
fprintf(stderr, "netlink receive error %s (%d)\n",
strerror(errno), errno);
return -1;