diff --git a/src/shared/varlink.c b/src/shared/varlink.c index 4f7ac976891..4d2cfee4918 100644 --- a/src/shared/varlink.c +++ b/src/shared/varlink.c @@ -1025,7 +1025,7 @@ static void handle_revents(Varlink *v, int revents) { 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 @@ -1075,6 +1075,9 @@ int varlink_wait(Varlink *v, usec_t timeout) { 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; @@ -1161,8 +1164,12 @@ int varlink_flush(Varlink *v) { } 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);