# HG changeset patch # User Karl Heuer # Date 766734778 0 # Node ID 67b16a9f7e5d76c383f84aba3f093e916611bfa9 # Parent 8505df26e31d228584c297ea702cbe7ffcdf64f2 (read_avail_input): Write loop as a do-while. diff -r 8505df26e31d -r 67b16a9f7e5d src/keyboard.c --- a/src/keyboard.c Tue Apr 19 04:40:29 1994 +0000 +++ b/src/keyboard.c Tue Apr 19 05:52:58 1994 +0000 @@ -3339,7 +3339,7 @@ /* 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 @@ 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)