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

Diff for /src/usr.bin/telnet/terminal.c between version 1.8 and 1.9

version 1.8, 2014/07/20 06:24:19 version 1.9, 2014/07/20 07:35:04
Line 32 
Line 32 
   
 #include "telnet_locl.h"  #include "telnet_locl.h"
   
   #include <unistd.h>
   
 Ring            ttyoring, ttyiring;  Ring            ttyoring, ttyiring;
 unsigned char   ttyobuf[2*BUFSIZ], ttyibuf[BUFSIZ];  unsigned char   ttyobuf[2*BUFSIZ], ttyibuf[BUFSIZ];
   
Line 75 
Line 77 
 void  void
 init_terminal()  init_terminal()
 {  {
           struct termios tc;
   
         ring_init(&ttyoring, ttyobuf, sizeof ttyobuf);          ring_init(&ttyoring, ttyobuf, sizeof ttyobuf);
         ring_init(&ttyiring, ttyibuf, sizeof ttyibuf);          ring_init(&ttyiring, ttyibuf, sizeof ttyibuf);
         autoflush = TerminalAutoFlush();  
           tcgetattr(0, &tc);
           autoflush = (tc.c_lflag & NOFLSH) == 0;
 }  }
   
   
Line 101 
Line 107 
     n0 = ring_full_count(&ttyoring);      n0 = ring_full_count(&ttyoring);
     if ((n1 = n = ring_full_consecutive(&ttyoring)) > 0) {      if ((n1 = n = ring_full_consecutive(&ttyoring)) > 0) {
         if (drop) {          if (drop) {
             TerminalFlushOutput();              tcflush(fileno(stdout), TCOFLUSH);
             /* we leave 'n' alone! */              /* we leave 'n' alone! */
         } else {          } else {
             n = TerminalWrite((char *)ttyoring.consume, n);              n = write(tout, ttyoring.consume, n);
         }          }
     }      }
     if (n > 0) {      if (n > 0) {
Line 119 
Line 125 
         if (n1 == n && n0 > n) {          if (n1 == n && n0 > n) {
                 n1 = n0 - n;                  n1 = n0 - n;
                 if (!drop)                  if (!drop)
                         n1 = TerminalWrite(ttyoring.bottom, n1);                          n1 = write(tout, ttyoring.bottom, n1);
                 if (n1 > 0)                  if (n1 > 0)
                         n += n1;                          n += n1;
         }          }

Legend:
Removed from v.1.8  
changed lines
  Added in v.1.9