summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormillert <millert@openbsd.org>2009-06-02 00:21:32 +0000
committermillert <millert@openbsd.org>2009-06-02 00:21:32 +0000
commit8bc88c101c5f75e257caed4883447a1c8b301ca0 (patch)
tree5021afd7e2ab60ce0809e6d6741f34d2803141d1
parentMove the rest of the rib dump functions into rde_rib.c where it belongs. (diff)
downloadwireguard-openbsd-8bc88c101c5f75e257caed4883447a1c8b301ca0.tar.xz
wireguard-openbsd-8bc88c101c5f75e257caed4883447a1c8b301ca0.zip
If the read from the tty fails with EAGAIN, pop back up to the select.
Seems to happen occasionally even though select reported the fd is ready. OK ray@
-rw-r--r--usr.bin/vi/cl/cl_read.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/usr.bin/vi/cl/cl_read.c b/usr.bin/vi/cl/cl_read.c
index 315806019ac..a1e61316ea4 100644
--- a/usr.bin/vi/cl/cl_read.c
+++ b/usr.bin/vi/cl/cl_read.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cl_read.c,v 1.15 2007/09/02 15:19:35 deraadt Exp $ */
+/* $OpenBSD: cl_read.c,v 1.16 2009/06/02 00:21:32 millert Exp $ */
/*-
* Copyright (c) 1993, 1994
@@ -188,6 +188,7 @@ cl_read(sp, flags, bp, blen, nrp, tp)
* 2: A read with an associated timeout, e.g., trying to complete
* a map sequence. If input exists, we fall into #3.
*/
+tty_retry:
if (tp != NULL) {
memset(rdfd, 0, howmany(STDIN_FILENO + 1, NFDBITS)
* sizeof(fd_mask));
@@ -296,6 +297,8 @@ loop: memset(rdfd, 0, howmany(maxfd + 1, NFDBITS) * sizeof(fd_mask));
case -1: /* Error or interrupt. */
err: if (errno == EINTR)
rval = INP_INTR;
+ else if (errno == EAGAIN)
+ goto tty_retry;
else {
rval = INP_ERR;
msgq(sp, M_SYSERR, "input");