Changeset 13095


Ignore:
Timestamp:
Oct 23, 2009, 5:19:57 PM (10 years ago)
Author:
rme
Message:

In readc(): Clear stream error status when retrying after EINTR or EIO. Also,
put a limit on how many times we'll retry after EINTR or EIO.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/lisp-kernel/lisp-debug.c

    r13067 r13095  
    160160readc()
    161161{
     162  unsigned tries = 1000;
    162163  int c;
    163   while (1) {
     164
     165  while (tries) {
    164166    c = getchar();
    165167    switch(c) {
     
    171173      if (ferror(stdin)) {
    172174        if ((errno == EINTR) || (errno == EIO)) {
     175          clearerr(stdin);
     176          tries--;
    173177          continue;
    174178        }
     
    179183    }
    180184  }
     185  return EOF;
    181186}
    182187
Note: See TracChangeset for help on using the changeset viewer.