version 1.34, 1999/12/08 12:57:06 |
version 1.35, 2000/05/03 19:50:41 |
|
|
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; |