summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2009-06-02 00:21:33 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2009-06-02 00:21:33 +0000
commitd0d4b2880b2deaac2e571dd5845b69915b720e5c (patch)
tree72937691d31e8ea711f38d9b8218aaa4238698cc /usr.bin
parent91b65a13e6f13562d5bf9d4316852b58117eae36 (diff)
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@
Diffstat (limited to 'usr.bin')
-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");