aboutsummaryrefslogtreecommitdiffstats
path: root/src/keyboard.c
diff options
context:
space:
mode:
authorKarl Heuer <[email protected]>1994-04-19 05:52:58 +0000
committerKarl Heuer <[email protected]>1994-04-19 05:52:58 +0000
commit9134775b88c462d5fbf4c0c33a1af806f562343c (patch)
treeda24ae7f8f92b7acedc900c273ab73e88004e80b /src/keyboard.c
parent02b3c4338e21166fb1c3fdd85b9c860ac675d125 (diff)
(read_avail_input): Write loop as a do-while.
Diffstat (limited to 'src/keyboard.c')
-rw-r--r--src/keyboard.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/keyboard.c b/src/keyboard.c
index 434d019c6e..affd373655 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -3339,7 +3339,7 @@ read_avail_input (expected)
/* Now read; for one reason or another, this will not block.
NREAD is set to the number of chars read. */
- while (1)
+ do
{
#ifdef MSDOS
cbuf[0] = dos_keyread();
@@ -3356,17 +3356,15 @@ read_avail_input (expected)
kill (0, SIGHUP);
#endif
/* Retry the read if it was interrupted. */
- if (nread >= 0
- || ! (errno == EAGAIN
+ }
+ while (nread < 0 && (errno == EAGAIN
#ifdef EFAULT
- || errno == EFAULT
+ || errno == EFAULT
#endif
#ifdef EBADSLT
- || errno == EBADSLT
+ || errno == EBADSLT
#endif
- ))
- break;
- }
+ ));
#ifndef FIONREAD
#if defined (USG) || defined (DGUX)