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

Diff for /src/usr.bin/telnet/sys_bsd.c between version 1.34 and 1.35

version 1.34, 2017/07/19 12:25:52 version 1.35, 2019/06/28 13:35:04
Line 355 
Line 355 
         sigprocmask(SIG_UNBLOCK, &mask, NULL);          sigprocmask(SIG_UNBLOCK, &mask, NULL);
         tmp_tc = old_tc;          tmp_tc = old_tc;
     }      }
     if (isatty(tin) && tcsetattr(tin, TCSADRAIN, &tmp_tc) < 0)      if (isatty(tin) && tcsetattr(tin, TCSADRAIN, &tmp_tc) == -1)
         tcsetattr(tin, TCSANOW, &tmp_tc);          tcsetattr(tin, TCSANOW, &tmp_tc);
   
     ioctl(tin, FIONBIO, &onoff);      ioctl(tin, FIONBIO, &onoff);
Line 381 
Line 381 
 {  {
     struct winsize ws;      struct winsize ws;
   
     if (ioctl(fileno(stdin), TIOCGWINSZ, &ws) >= 0) {      if (ioctl(fileno(stdin), TIOCGWINSZ, &ws) == 0) {
         *rows = ws.ws_row;          *rows = ws.ws_row;
         *cols = ws.ws_col;          *cols = ws.ws_col;
         return 1;          return 1;
Line 526 
Line 526 
         pfd[TELNET_FD_NET].fd = -1;          pfd[TELNET_FD_NET].fd = -1;
     }      }
   
     if ((c = poll(pfd, TELNET_FD_NUM, dopoll ? 0 : INFTIM)) < 0) {      if ((c = poll(pfd, TELNET_FD_NUM, dopoll ? 0 : INFTIM)) == -1) {
         return 0;          return 0;
     }      }
   
Line 546 
Line 546 
   
         canread = ring_empty_consecutive(&netiring);          canread = ring_empty_consecutive(&netiring);
         c = recv(net, netiring.supply, canread, 0);          c = recv(net, netiring.supply, canread, 0);
         if (c < 0 && errno == EWOULDBLOCK) {          if (c == -1 && errno == EWOULDBLOCK) {
             c = 0;              c = 0;
         } else if (c <= 0) {          } else if (c <= 0) {
             return -1;              return -1;
Line 564 
Line 564 
      */       */
     if (pfd[TELNET_FD_TIN].revents & (POLLIN|POLLHUP)) {      if (pfd[TELNET_FD_TIN].revents & (POLLIN|POLLHUP)) {
         c = read(tin, ttyiring.supply, ring_empty_consecutive(&ttyiring));          c = read(tin, ttyiring.supply, ring_empty_consecutive(&ttyiring));
         if (c < 0 && errno == EIO)          if (c == -1 && errno == EIO)
             c = 0;              c = 0;
         if (c < 0 && errno == EWOULDBLOCK) {          if (c == -1 && errno == EWOULDBLOCK) {
             c = 0;              c = 0;
         } else {          } else {
             /* EOF detection for line mode!!!! */              /* EOF detection for line mode!!!! */

Legend:
Removed from v.1.34  
changed lines
  Added in v.1.35