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

Diff for /src/usr.bin/ssh/sshconnect.c between version 1.141 and 1.142

version 1.141, 2003/05/15 14:55:25 version 1.142, 2003/05/23 08:29:30
Line 221 
Line 221 
         fd_set *fdset;          fd_set *fdset;
         struct timeval tv;          struct timeval tv;
         socklen_t optlen;          socklen_t optlen;
         int fdsetsz, optval, rc;          int fdsetsz, optval, rc, result = -1;
   
         if (timeout <= 0)          if (timeout <= 0)
                 return (connect(sockfd, serv_addr, addrlen));                  return (connect(sockfd, serv_addr, addrlen));
Line 253 
Line 253 
         case 0:          case 0:
                 /* Timed out */                  /* Timed out */
                 errno = ETIMEDOUT;                  errno = ETIMEDOUT;
                 return (-1);                  break;
         case -1:          case -1:
                 /* Select error */                  /* Select error */
                 debug("select: %s", strerror(errno));                  debug("select: %s", strerror(errno));
                 return (-1);                  break;
         case 1:          case 1:
                 /* Completed or failed */                  /* Completed or failed */
                 optval = 0;                  optval = 0;
Line 265 
Line 265 
                 if (getsockopt(sockfd, SOL_SOCKET, SO_ERROR, &optval,                  if (getsockopt(sockfd, SOL_SOCKET, SO_ERROR, &optval,
                     &optlen) == -1)                      &optlen) == -1)
                         debug("getsockopt: %s", strerror(errno));                          debug("getsockopt: %s", strerror(errno));
                         return (-1);                          break;
                 if (optval != 0) {                  if (optval != 0) {
                         errno = optval;                          errno = optval;
                         return (-1);                          break;
                 }                  }
                   result = 0;
                 break;                  break;
         default:          default:
                 /* Should not occur */                  /* Should not occur */
                 fatal("Bogus return (%d) from select()", rc);                  fatal("Bogus return (%d) from select()", rc);
         }          }
   
         return (0);          xfree(fdset);
           return (result);
 }  }
   
 /*  /*

Legend:
Removed from v.1.141  
changed lines
  Added in v.1.142