diff options
| author | Dag-Erling Smørgrav <des@FreeBSD.org> | 2014-01-30 10:56:49 +0000 |
|---|---|---|
| committer | Dag-Erling Smørgrav <des@FreeBSD.org> | 2014-01-30 10:56:49 +0000 |
| commit | 02d4c2ac3daa0f36264392972709ccd7676ab3e8 (patch) | |
| tree | 6c519c109631364b652faced88b665da4b6058ae /atomicio.c | |
| parent | ff96c0c81d9ee141236b95d52ad0578684d59ab5 (diff) | |
Vendor import of OpenSSH 6.5p1.vendor/openssh/6.5p1
Diffstat (limited to 'atomicio.c')
| -rw-r--r-- | atomicio.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/atomicio.c b/atomicio.c index 601b3c371c21..2bac36c91cd7 100644 --- a/atomicio.c +++ b/atomicio.c @@ -56,8 +56,10 @@ atomicio6(ssize_t (*f) (int, void *, size_t), int fd, void *_s, size_t n, ssize_t res; struct pollfd pfd; +#ifndef BROKEN_READ_COMPARISON pfd.fd = fd; pfd.events = f == read ? POLLIN : POLLOUT; +#endif while (n > pos) { res = (f) (fd, s + pos, n - pos); switch (res) { @@ -65,7 +67,9 @@ atomicio6(ssize_t (*f) (int, void *, size_t), int fd, void *_s, size_t n, if (errno == EINTR) continue; if (errno == EAGAIN || errno == EWOULDBLOCK) { +#ifndef BROKEN_READ_COMPARISON (void)poll(&pfd, 1, -1); +#endif continue; } return 0; |
