diff options
author | Damien Miller <djm@mindrot.org> | 2007-09-21 05:12:49 +0200 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2007-09-21 05:12:49 +0200 |
commit | ed626b42cc4414235fc2181cc139362e5e054b04 (patch) | |
tree | 614e67ed7133c6766ea22c5d8c7588f1f0970362 /atomicio.c | |
parent | - (tim) [defines.h] Fix regression in long password support on OpenServer 6. (diff) | |
download | openssh-ed626b42cc4414235fc2181cc139362e5e054b04.tar.xz openssh-ed626b42cc4414235fc2181cc139362e5e054b04.zip |
- (djm) [atomicio.c] Fix spin avoidance for platforms that define
EWOULDBLOCK; patch from ben AT psc.edu
Diffstat (limited to 'atomicio.c')
-rw-r--r-- | atomicio.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/atomicio.c b/atomicio.c index f32ff85ba..62ee40282 100644 --- a/atomicio.c +++ b/atomicio.c @@ -57,13 +57,13 @@ atomicio(ssize_t (*f) (int, void *, size_t), int fd, void *_s, size_t n) res = (f) (fd, s + pos, n - pos); switch (res) { case -1: -#ifdef EWOULDBLOCK - if (errno == EINTR || errno == EWOULDBLOCK) -#else if (errno == EINTR) -#endif continue; +#ifdef EWOULDBLOCK + if (errno == EAGAIN || errno == EWOULDBLOCK) { +#else if (errno == EAGAIN) { +#endif (void)poll(&pfd, 1, -1); continue; } @@ -103,13 +103,13 @@ atomiciov(ssize_t (*f) (int, const struct iovec *, int), int fd, res = (f) (fd, iov, iovcnt); switch (res) { case -1: -#ifdef EWOULDBLOCK - if (errno == EINTR || errno == EWOULDBLOCK) -#else if (errno == EINTR) -#endif continue; +#ifdef EWOULDBLOCK + if (errno == EAGAIN || errno == EWOULDBLOCK) { +#else if (errno == EAGAIN) { +#endif (void)poll(&pfd, 1, -1); continue; } |