summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2007-09-21 13:12:49 +1000
committerDamien Miller <djm@mindrot.org>2007-09-21 13:12:49 +1000
commited626b42cc4414235fc2181cc139362e5e054b04 (patch)
tree614e67ed7133c6766ea22c5d8c7588f1f0970362
parent6ebefac25a5fb7a900cd8342390cfac7a81bd35d (diff)
- (djm) [atomicio.c] Fix spin avoidance for platforms that define
EWOULDBLOCK; patch from ben AT psc.edu
-rw-r--r--ChangeLog6
-rw-r--r--atomicio.c16
2 files changed, 13 insertions, 9 deletions
diff --git a/ChangeLog b/ChangeLog
index b0e4c46f..b03e768e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+20070921
+ - (djm) [atomicio.c] Fix spin avoidance for platforms that define
+ EWOULDBLOCK; patch from ben AT psc.edu
+
20070917
- (djm) OpenBSD CVS Sync
- djm@cvs.openbsd.org 2007/08/23 02:49:43
@@ -3258,4 +3262,4 @@
OpenServer 6 and add osr5bigcrypt support so when someone migrates
passwords between UnixWare and OpenServer they will still work. OK dtucker@
-$Id: ChangeLog,v 1.4757 2007/09/17 15:32:32 tim Exp $
+$Id: ChangeLog,v 1.4758 2007/09/21 03:12:49 djm Exp $
diff --git a/atomicio.c b/atomicio.c
index f32ff85b..62ee4028 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;
}