- if ((c = c-loop)) {
- ring_supply_data(&ttyoring, buffer-c, c);
- count -= c;
- }
- }
- return(origCount - count);
-}
-
-/* EmptyTerminal - called to make sure that the terminal buffer is empty.
- * Note that we consider the buffer to run all the
- * way to the kernel (thus the select).
- */
-
-void
-EmptyTerminal()
-{
-#if defined(unix)
- fd_set o;
-
- FD_ZERO(&o);
-#endif /* defined(unix) */
-
- if (TTYBYTES()) {
-#if defined(unix)
- FD_SET(tout, &o);
- (void) select(tout+1, (int *) 0, &o, (int *) 0,
- (struct timeval *) 0); /* wait for TTLOWAT */
-#endif /* defined(unix) */
- } else {
- while (TTYBYTES()) {
- ttyflush(0);
-#if defined(unix)
- FD_SET(tout, &o);
- (void) select(tout+1, (int *) 0, &o, (int *) 0,
- (struct timeval *) 0); /* wait for TTLOWAT */
-#endif /* defined(unix) */