if ((revents & (POLLOUT|POLLHUP)) == 0)
return;
- varlink_log(v, "Anynchronous connection completed.");
+ varlink_log(v, "Asynchronous connection completed.");
v->connecting = false;
} else {
/* Note that we don't care much about POLLIN/POLLOUT here, we'll just try reading and writing
return events;
r = fd_wait_for_event(fd, events, t);
+ if (r < 0 && ERRNO_IS_TRANSIENT(r)) /* Treat EINTR as not a timeout, but also nothing happened, and
+ * the caller gets a chance to call back into us */
+ return 1;
if (r <= 0)
return r;
}
r = fd_wait_for_event(v->fd, POLLOUT, USEC_INFINITY);
- if (r < 0)
+ if (r < 0) {
+ if (ERRNO_IS_TRANSIENT(r))
+ continue;
+
return varlink_log_errno(v, r, "Poll failed on fd: %m");
+ }
assert(r != 0);