chiark / gitweb /
sd-rtnl: recv_message - don't fail on interrupt
authorTom Gundersen <teg@jklm.no>
Mon, 29 Dec 2014 00:49:06 +0000 (01:49 +0100)
committerTom Gundersen <teg@jklm.no>
Mon, 29 Dec 2014 00:59:49 +0000 (01:59 +0100)
We should just try again instead.

src/libsystemd/sd-rtnl/rtnl-message.c

index cfb2af3..92f3182 100644 (file)
@@ -1348,8 +1348,10 @@ static int socket_recv_message(int fd, struct iovec *iov, uint32_t *_group, bool
                 /* no data */
                 if (errno == ENOBUFS)
                         log_debug("rtnl: kernel receive buffer overrun");
+                else if (errno == EAGAIN)
+                        log_debug("rtnl: no data in socket");
 
-                return (errno == EAGAIN) ? 0 : -errno;
+                return (errno == EAGAIN || errno == EINTR) ? 0 : -errno;
         } else if (r == 0)
                 /* connection was closed by the kernel */
                 return -ECONNRESET;