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

Diff for /src/usr.bin/nc/netcat.c between version 1.48 and 1.49

version 1.48, 2002/05/29 09:23:25 version 1.49, 2002/05/30 09:37:38
Line 66 
Line 66 
 int     xflag;                                  /* Socks proxy */  int     xflag;                                  /* Socks proxy */
 int     zflag;                                  /* Port Scan Flag */  int     zflag;                                  /* Port Scan Flag */
   
 int timeout;  int timeout = -1;
 int family = AF_UNSPEC;  int family = AF_UNSPEC;
 char *portlist[PORT_MAX];  char *portlist[PORT_MAX];
   
Line 160 
Line 160 
                         timeout = (int)strtoul(optarg, &endp, 10);                          timeout = (int)strtoul(optarg, &endp, 10);
                         if (timeout < 0 || *endp != '\0')                          if (timeout < 0 || *endp != '\0')
                                 errx(1, "timeout cannot be negative");                                  errx(1, "timeout cannot be negative");
                           if (timeout >= (INT_MAX / 1000))
                                   errx(1, "timeout too large");
                           timeout *= 1000;
                         break;                          break;
                 case 'x':                  case 'x':
                         xflag = 1;                          xflag = 1;
Line 548 
Line 551 
                 if (iflag)                  if (iflag)
                         sleep(iflag);                          sleep(iflag);
   
                 if (poll(pfd, 2, timeout) < 0) {                  if ((n = poll(pfd, 2, timeout)) < 0) {
                         close(nfd);                          close(nfd);
                         close(wfd);                          close(wfd);
                         free(pfd);                          free(pfd);
                         errx(1, "Polling Error");                          errx(1, "Polling Error");
                 }                  }
   
                   if (n == 0)
                           return;
   
                 if (pfd[0].revents & POLLIN) {                  if (pfd[0].revents & POLLIN) {
                         if ((n = read(nfd, buf, sizeof(buf))) <= 0) {                          if ((n = read(nfd, buf, sizeof(buf))) <= 0) {

Legend:
Removed from v.1.48  
changed lines
  Added in v.1.49