summaryrefslogtreecommitdiffstats
path: root/atomicio.c
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2008-07-05 09:36:58 +1000
committerDamien Miller <djm@mindrot.org>2008-07-05 09:36:58 +1000
commit20d16947190d17f9ed8db983bee6cb7bd20722b5 (patch)
tree4048846ae4e22af8cb180200890386cb83e24308 /atomicio.c
parent22989f1b5e845830abb2f0598907a9894e9fcb4b (diff)
- (djm) [atomicio.c configure.ac] Disable poll() fallback in atomiciov for
Tru64. readv doesn't seem to be a comparable object there. bz#1386, patch from dtucker@ ok me
Diffstat (limited to 'atomicio.c')
-rw-r--r--atomicio.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/atomicio.c b/atomicio.c
index bb44c323..a6b2d127 100644
--- a/atomicio.c
+++ b/atomicio.c
@@ -97,8 +97,10 @@ 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) {
@@ -106,7 +108,9 @@ atomiciov(ssize_t (*f) (int, const struct iovec *, int), int fd,
if (errno == EINTR)
continue;
if (errno == EAGAIN || errno == EWOULDBLOCK) {
+#ifndef BROKEN_READV_COMPARISON
(void)poll(&pfd, 1, -1);
+#endif
continue;
}
return 0;