[BACK]Return to ttyio.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / mg

Diff for /src/usr.bin/mg/ttyio.c between version 1.13 and 1.14

version 1.13, 2001/01/29 01:58:10 version 1.14, 2001/05/03 20:40:22
Line 213 
Line 213 
         exit(1);          exit(1);
 }  }
   
 #ifndef NO_DPROMPT  
 /*  /*
  * A program to return TRUE if we wait for 2 seconds without anything   * This function returns FALSE if any characters have showed up on the
  * happening, else return FALSE.  Cribbed from mod.sources xmodem.   * tty before 'msec' miliseconds.
  */   */
 int  int
 ttwait()  ttwait(int msec)
 {  {
         fd_set          readfds;          fd_set          readfds;
         struct timeval  tmout;          struct timeval  tmout;
Line 227 
Line 226 
         FD_ZERO(&readfds);          FD_ZERO(&readfds);
         FD_SET(0, &readfds);          FD_SET(0, &readfds);
   
         tmout.tv_sec = 2;          tmout.tv_sec = msec/1000;
         tmout.tv_usec = 0;          tmout.tv_usec = msec - tmout.tv_sec * 1000;
   
         if ((select(1, &readfds, NULL, NULL, &tmout)) == 0)          if ((select(1, &readfds, NULL, NULL, &tmout)) == 0)
                 return (TRUE);                  return (TRUE);
         return (FALSE);          return (FALSE);
 }  }
 #endif /* NO_DPROMPT */  

Legend:
Removed from v.1.13  
changed lines
  Added in v.1.14