chiark / gitweb /
sd-rtnl: rtnl_call - don't dispatch wqueue after timeout has passed
[elogind.git] / src / libsystemd / sd-rtnl / sd-rtnl.c
index 1af38f3667d5c50a4045963dbb7c6ca4f62d1dd9..7d388c975860bc4c42a0be633fe7fb3ed3415c89 100644 (file)
@@ -140,6 +140,10 @@ int sd_rtnl_open(sd_rtnl **ret, unsigned n_groups, ...) {
         return 0;
 }
 
+int sd_rtnl_inc_rcvbuf(const sd_rtnl *const rtnl, const int size) {
+        return fd_inc_rcvbuf(rtnl->fd, size);
+}
+
 sd_rtnl *sd_rtnl_ref(sd_rtnl *rtnl) {
         assert_return(rtnl, NULL);
         assert_return(!rtnl_pid_changed(rtnl), NULL);
@@ -485,7 +489,7 @@ static int rtnl_poll(sd_rtnl *rtnl, bool need_more, uint64_t timeout_usec) {
         if (need_more)
                 /* Caller wants more data, and doesn't care about
                  * what's been read or any other timeouts. */
-                return e |= POLLIN;
+                e |= POLLIN;
         else {
                 usec_t until;
                 /* Caller wants to process if there is something to
@@ -697,6 +701,8 @@ int sd_rtnl_call(sd_rtnl *rtnl,
                 r = rtnl_poll(rtnl, true, left);
                 if (r < 0)
                         return r;
+                else if (r == 0)
+                        return -ETIMEDOUT;
 
                 r = dispatch_wqueue(rtnl);
                 if (r < 0)