summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordjm <djm>2014-01-30 00:26:46 +0000
committerdjm <djm>2014-01-30 00:26:46 +0000
commit6882fae00daccee2d3a55a6248effd7732e15cae (patch)
tree5e94f30ebc048822b599fd2d90ed1fa5c9e00164
parentbbced47ad0d0d0c6c559afcd2923b0e7c856cc55 (diff)
downloadopenssh-6882fae00daccee2d3a55a6248effd7732e15cae.tar.gz
- (djm) [configure.ac atomicio.c] Kludge around NetBSD offering
different symbols for 'read' when various compiler flags are in use, causing atomicio.c comparisons against it to break and read/write operations to hang; ok dtucker
-rw-r--r--ChangeLog4
-rw-r--r--atomicio.c4
-rw-r--r--configure.ac6
3 files changed, 12 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 05e75342..cf7e12f0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,10 @@
- (djm) [configure.ac] Only check for width-specified integer types
in headers that actually exist. patch from Tom G. Christensen;
ok dtucker@
+ - (djm) [configure.ac atomicio.c] Kludge around NetBSD offering
+ different symbols for 'read' when various compiler flags are
+ in use, causing atomicio.c comparisons against it to break and
+ read/write operations to hang; ok dtucker
20140129
- (djm) [configure.ac] Fix broken shell test '==' vs '='; patch from
diff --git a/atomicio.c b/atomicio.c
index 601b3c37..2bac36c9 100644
--- a/atomicio.c
+++ b/atomicio.c
@@ -56,8 +56,10 @@ atomicio6(ssize_t (*f) (int, void *, size_t), int fd, void *_s, size_t n,
ssize_t res;
struct pollfd pfd;
+#ifndef BROKEN_READ_COMPARISON
pfd.fd = fd;
pfd.events = f == read ? POLLIN : POLLOUT;
+#endif
while (n > pos) {
res = (f) (fd, s + pos, n - pos);
switch (res) {
@@ -65,7 +67,9 @@ atomicio6(ssize_t (*f) (int, void *, size_t), int fd, void *_s, size_t n,
if (errno == EINTR)
continue;
if (errno == EAGAIN || errno == EWOULDBLOCK) {
+#ifndef BROKEN_READ_COMPARISON
(void)poll(&pfd, 1, -1);
+#endif
continue;
}
return 0;
diff --git a/configure.ac b/configure.ac
index 57136216..dfd32cd8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,4 +1,4 @@
-# $Id: configure.ac,v 1.567 2014/01/29 23:21:20 djm Exp $
+# $Id: configure.ac,v 1.568 2014/01/30 00:26:46 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.567 $)
+AC_REVISION($Revision: 1.568 $)
AC_CONFIG_SRCDIR([ssh.c])
AC_LANG([C])
@@ -769,6 +769,8 @@ mips-sony-bsd|mips-sony-newsos4)
TEST_MALLOC_OPTIONS="AJRX"
AC_DEFINE([BROKEN_STRNVIS], [1],
[NetBSD strnvis argument order is swapped compared to OpenBSD])
+ AC_DEFINE([BROKEN_READ_COMPARISON], [1],
+ [NetBSD read function is sometimes redirected, breaking atomicio comparisons against it])
;;
*-*-freebsd*)
check_for_libcrypt_later=1