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

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

version 1.34, 1999/12/08 12:57:06 version 1.35, 2000/05/03 19:50:41
Line 145 
Line 145 
         hints.ai_socktype = SOCK_STREAM;          hints.ai_socktype = SOCK_STREAM;
         hints.ai_protocol = 0;          hints.ai_protocol = 0;
         error = getaddrinfo(host, port, &hints, &res0);          error = getaddrinfo(host, port, &hints, &res0);
           if (error == EAI_SERVICE) {
                   /*
                    * If the services file is corrupt/missing, fall back
                    * on our hard-coded defines.
                    */
                   char pbuf[NI_MAXSERV];
   
                   pbuf[0] = '\0';
                   if (strcmp(port, "ftp") == 0)
                           snprintf(pbuf, sizeof(pbuf), "%d", FTP_PORT);
                   else if (strcmp(port, "ftpgate") == 0)
                           snprintf(pbuf, sizeof(pbuf), "%d", GATE_PORT);
                   else if (strcmp(port, "http") == 0)
                           snprintf(pbuf, sizeof(pbuf), "%d", HTTP_PORT);
                   if (pbuf[0])
                           error = getaddrinfo(host, pbuf, &hints, &res0);
           }
         if (error) {          if (error) {
                 warn(gai_strerror(error));                  warn(gai_strerror(error));
                 code = -1;                  code = -1;

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