X-Git-Url: http://andersk.mit.edu/gitweb/gssapi-openssh.git/blobdiff_plain/602aedb153244f33c78a7b37a173fb7a09a01475..5156b1a1fca465f5acd9a09f208d610a64ec2ab3:/openssh/atomicio.c diff --git a/openssh/atomicio.c b/openssh/atomicio.c index 575bf89..a6b2d12 100644 --- a/openssh/atomicio.c +++ b/openssh/atomicio.c @@ -63,11 +63,7 @@ atomicio(ssize_t (*f) (int, void *, size_t), int fd, void *_s, size_t n) case -1: if (errno == EINTR) continue; -#ifdef EWOULDBLOCK if (errno == EAGAIN || errno == EWOULDBLOCK) { -#else - if (errno == EAGAIN) { -#endif (void)poll(&pfd, 1, -1); continue; } @@ -101,20 +97,20 @@ atomiciov(ssize_t (*f) (int, const struct iovec *, int), int fd, /* Make a copy of the iov array because we may modify it below */ memcpy(iov, _iov, iovcnt * sizeof(*_iov)); +#ifndef BROKEN_READV_COMPARISON pfd.fd = fd; pfd.events = f == readv ? POLLIN : POLLOUT; +#endif for (; iovcnt > 0 && iov[0].iov_len > 0;) { res = (f) (fd, iov, iovcnt); switch (res) { case -1: if (errno == EINTR) continue; -#ifdef EWOULDBLOCK if (errno == EAGAIN || errno == EWOULDBLOCK) { -#else - if (errno == EAGAIN) { -#endif +#ifndef BROKEN_READV_COMPARISON (void)poll(&pfd, 1, -1); +#endif continue; } return 0;