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

Diff for /src/usr.bin/telnet/network.c between version 1.3 and 1.4

version 1.3, 1996/12/12 11:35:59 version 1.4, 1997/12/16 22:07:38
Line 86 
Line 86 
 stilloob()  stilloob()
 {  {
     static struct timeval timeout = { 0 };      static struct timeval timeout = { 0 };
     fd_set      excepts;      fd_set *fdsp;
       int fdsn;
     int value;      int value;
   
       fdsn = howmany(net+1, NFDBITS) * sizeof(fd_mask);
       if ((fdsp = (fd_set *)malloc(fdsn)) == NULL)
           err(1, "malloc");
   
     do {      do {
         FD_ZERO(&excepts);          memset(fdsp, 0, fdsn);
         FD_SET(net, &excepts);          FD_SET(net, fdsp);
         value = select(net+1, (fd_set *)0, (fd_set *)0, &excepts, &timeout);          value = select(net+1, (fd_set *)0, (fd_set *)0, fdsp, &timeout);
     } while ((value == -1) && (errno == EINTR));      } while ((value == -1) && (errno == EINTR));
   
     if (value < 0) {      if (value < 0) {
         perror("select");          perror("select");
           free(fdsp);
         (void) quit();          (void) quit();
         /* NOTREACHED */          /* NOTREACHED */
     }      }
     if (FD_ISSET(net, &excepts)) {      if (FD_ISSET(net, fdsp)) {
           free(fdsp);
         return 1;          return 1;
     } else {      } else {
           free(fdsp);
         return 0;          return 0;
     }      }
 }  }

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.4