From 20d16947190d17f9ed8db983bee6cb7bd20722b5 Mon Sep 17 00:00:00 2001 From: Damien Miller Date: Sat, 5 Jul 2008 09:36:58 +1000 Subject: [PATCH] - (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 --- ChangeLog | 5 ++++- atomicio.c | 4 ++++ configure.ac | 5 +++-- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 515bd9184..c1df7b87e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,9 @@ - (djm) [auth.c] Fixed test for locked account on HP/UX with shadowed passwords disabled. bz#1083 report & patch from senthilkumar_sen AT hotpop.com, w/ dtucker@ + - (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 20080704 - (dtucker) OpenBSD CVS Sync @@ -4575,4 +4578,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.5059 2008/07/04 22:59:43 djm Exp $ +$Id: ChangeLog,v 1.5060 2008/07/04 23:36:58 djm Exp $ diff --git a/atomicio.c b/atomicio.c index bb44c3230..a6b2d127a 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; diff --git a/configure.ac b/configure.ac index eb71a879a..330b0eb5e 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,4 @@ -# $Id: configure.ac,v 1.406 2008/06/15 16:27:48 dtucker Exp $ +# $Id: configure.ac,v 1.407 2008/07/04 23:36:58 djm Exp $ # # Copyright (c) 1999-2004 Damien Miller # @@ -15,7 +15,7 @@ # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. AC_INIT(OpenSSH, Portable, openssh-unix-dev@mindrot.org) -AC_REVISION($Revision: 1.406 $) +AC_REVISION($Revision: 1.407 $) AC_CONFIG_SRCDIR([ssh.c]) AC_CONFIG_HEADER(config.h) @@ -841,6 +841,7 @@ mips-sony-bsd|mips-sony-newsos4) AC_DEFINE(SETEUID_BREAKS_SETUID) AC_DEFINE(BROKEN_SETREUID) AC_DEFINE(BROKEN_SETREGID) + AC_DEFINE(BROKEN_READV_COMPARISON, 1, [Can't do comparisons on readv])) ;; *-*-nto-qnx*)