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

Diff for /src/usr.bin/ssh/ssh-keyscan.c between version 1.127 and 1.128

version 1.127, 2019/06/06 05:13:13 version 1.128, 2019/06/28 13:35:04
Line 115 
Line 115 
 {  {
         struct rlimit rlfd;          struct rlimit rlfd;
   
         if (getrlimit(RLIMIT_NOFILE, &rlfd) < 0)          if (getrlimit(RLIMIT_NOFILE, &rlfd) == -1)
                 return (-1);                  return (-1);
         if ((hard ? rlfd.rlim_max : rlfd.rlim_cur) == RLIM_INFINITY)          if ((hard ? rlfd.rlim_max : rlfd.rlim_cur) == RLIM_INFINITY)
                 return sysconf(_SC_OPEN_MAX);                  return sysconf(_SC_OPEN_MAX);
Line 130 
Line 130 
   
         if (lim <= 0)          if (lim <= 0)
                 return (-1);                  return (-1);
         if (getrlimit(RLIMIT_NOFILE, &rlfd) < 0)          if (getrlimit(RLIMIT_NOFILE, &rlfd) == -1)
                 return (-1);                  return (-1);
         rlfd.rlim_cur = lim;          rlfd.rlim_cur = lim;
         if (setrlimit(RLIMIT_NOFILE, &rlfd) < 0)          if (setrlimit(RLIMIT_NOFILE, &rlfd) == -1)
                 return (-1);                  return (-1);
         return (0);          return (0);
 }  }
Line 325 
Line 325 
         }          }
         for (ai = aitop; ai; ai = ai->ai_next) {          for (ai = aitop; ai; ai = ai->ai_next) {
                 s = socket(ai->ai_family, ai->ai_socktype, ai->ai_protocol);                  s = socket(ai->ai_family, ai->ai_socktype, ai->ai_protocol);
                 if (s < 0) {                  if (s == -1) {
                         error("socket: %s", strerror(errno));                          error("socket: %s", strerror(errno));
                         continue;                          continue;
                 }                  }
                 if (set_nonblock(s) == -1)                  if (set_nonblock(s) == -1)
                         fatal("%s: set_nonblock(%d)", __func__, s);                          fatal("%s: set_nonblock(%d)", __func__, s);
                 if (connect(s, ai->ai_addr, ai->ai_addrlen) < 0 &&                  if (connect(s, ai->ai_addr, ai->ai_addrlen) == -1 &&
                     errno != EINPROGRESS)                      errno != EINPROGRESS)
                         error("connect (`%s'): %s", host, strerror(errno));                          error("connect (`%s'): %s", host, strerror(errno));
                 else                  else

Legend:
Removed from v.1.127  
changed lines
  Added in v.1.128