Fix compiler warnings. This closes some of the #458880 problem.

This commit is contained in:
Martin v. Löwis 2001-09-07 16:10:00 +00:00
parent a3891ea46c
commit 39e0c5daeb
1 changed files with 8 additions and 9 deletions

View File

@ -236,10 +236,8 @@ str_isnumber(p)
} }
int int
getaddrinfo(hostname, servname, hints, res) getaddrinfo(const char*hostname, const char*servname,
const char *hostname, *servname; const struct addrinfo *hints, struct addrinfo **res)
const struct addrinfo *hints;
struct addrinfo **res;
{ {
struct addrinfo sentinel; struct addrinfo sentinel;
struct addrinfo *top = NULL; struct addrinfo *top = NULL;
@ -367,15 +365,16 @@ getaddrinfo(hostname, servname, hints, res)
if ((sp = getservbyname(servname, proto)) == NULL) if ((sp = getservbyname(servname, proto)) == NULL)
ERR(EAI_SERVICE); ERR(EAI_SERVICE);
port = sp->s_port; port = sp->s_port;
if (pai->ai_socktype == GAI_ANY) if (pai->ai_socktype == GAI_ANY) {
if (strcmp(sp->s_proto, "udp") == 0) { if (strcmp(sp->s_proto, "udp") == 0) {
pai->ai_socktype = SOCK_DGRAM; pai->ai_socktype = SOCK_DGRAM;
pai->ai_protocol = IPPROTO_UDP; pai->ai_protocol = IPPROTO_UDP;
} else if (strcmp(sp->s_proto, "tcp") == 0) { } else if (strcmp(sp->s_proto, "tcp") == 0) {
pai->ai_socktype = SOCK_STREAM; pai->ai_socktype = SOCK_STREAM;
pai->ai_protocol = IPPROTO_TCP; pai->ai_protocol = IPPROTO_TCP;
} else } else
ERR(EAI_PROTOCOL); /*xxx*/ ERR(EAI_PROTOCOL); /*xxx*/
}
} }
} }