aboutsummaryrefslogtreecommitdiff
path: root/atomicio.c
diff options
context:
space:
mode:
authorDag-Erling Smørgrav <des@FreeBSD.org>2008-07-23 09:33:08 +0000
committerDag-Erling Smørgrav <des@FreeBSD.org>2008-07-23 09:33:08 +0000
commit5521539314d87d3432e3c5c0e74954a673a884bd (patch)
tree8f06d9ad2f958f06e579924065ecbaf74dd734f7 /atomicio.c
parentd4033b6b6f7aa0e69be09f9613e062e0fb7a9f11 (diff)
downloadsrc-5521539314d87d3432e3c5c0e74954a673a884bd.tar.gz
src-5521539314d87d3432e3c5c0e74954a673a884bd.zip
Notes
Diffstat (limited to 'atomicio.c')
-rw-r--r--atomicio.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/atomicio.c b/atomicio.c
index 575bf8900ee3..a6b2d127a9b8 100644
--- a/atomicio.c
+++ b/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;