[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.37 and 1.38

version 1.37, 2015/03/23 12:31:19 version 1.38, 2019/06/28 13:35:02
Line 62 
Line 62 
 int  int
 ttraw(void)  ttraw(void)
 {  {
         if (tcgetattr(0, &oldtty) < 0) {          if (tcgetattr(0, &oldtty) == -1) {
                 dobeep();                  dobeep();
                 ewprintf("ttopen can't get terminal attributes");                  ewprintf("ttopen can't get terminal attributes");
                 return (FALSE);                  return (FALSE);
Line 76 
Line 76 
         newtty.c_oflag &= ~OPOST;          newtty.c_oflag &= ~OPOST;
         newtty.c_lflag &= ~(ECHO | ECHONL | ICANON | ISIG | IEXTEN);          newtty.c_lflag &= ~(ECHO | ECHONL | ICANON | ISIG | IEXTEN);
   
         if (tcsetattr(0, TCSASOFT | TCSADRAIN, &newtty) < 0) {          if (tcsetattr(0, TCSASOFT | TCSADRAIN, &newtty) == -1) {
                 dobeep();                  dobeep();
                 ewprintf("ttopen can't tcsetattr");                  ewprintf("ttopen can't tcsetattr");
                 return (FALSE);                  return (FALSE);
Line 110 
Line 110 
 ttcooked(void)  ttcooked(void)
 {  {
         ttflush();          ttflush();
         if (tcsetattr(0, TCSASOFT | TCSADRAIN, &oldtty) < 0) {          if (tcsetattr(0, TCSASOFT | TCSADRAIN, &oldtty) == -1) {
                 dobeep();                  dobeep();
                 ewprintf("ttclose can't tcsetattr");                  ewprintf("ttclose can't tcsetattr");
                 return (FALSE);                  return (FALSE);
Line 188 
Line 188 
 {  {
         int     x;          int     x;
   
         return ((ioctl(0, FIONREAD, &x) < 0) ? 0 : x);          return ((ioctl(0, FIONREAD, &x) == -1) ? 0 : x);
 }  }
   
 /*  /*

Legend:
Removed from v.1.37  
changed lines
  Added in v.1.38