Skip to content

Commit 39e0c5d

Browse files
committed
Fix compiler warnings. This closes some of the #458880 problem.
1 parent a3891ea commit 39e0c5d

1 file changed

Lines changed: 8 additions & 9 deletions

File tree

Modules/getaddrinfo.c

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -236,10 +236,8 @@ str_isnumber(p)
236236
}
237237

238238
int
239-
getaddrinfo(hostname, servname, hints, res)
240-
const char *hostname, *servname;
241-
const struct addrinfo *hints;
242-
struct addrinfo **res;
239+
getaddrinfo(const char*hostname, const char*servname,
240+
const struct addrinfo *hints, struct addrinfo **res)
243241
{
244242
struct addrinfo sentinel;
245243
struct addrinfo *top = NULL;
@@ -367,15 +365,16 @@ getaddrinfo(hostname, servname, hints, res)
367365
if ((sp = getservbyname(servname, proto)) == NULL)
368366
ERR(EAI_SERVICE);
369367
port = sp->s_port;
370-
if (pai->ai_socktype == GAI_ANY)
368+
if (pai->ai_socktype == GAI_ANY) {
371369
if (strcmp(sp->s_proto, "udp") == 0) {
372370
pai->ai_socktype = SOCK_DGRAM;
373371
pai->ai_protocol = IPPROTO_UDP;
374372
} else if (strcmp(sp->s_proto, "tcp") == 0) {
375-
pai->ai_socktype = SOCK_STREAM;
376-
pai->ai_protocol = IPPROTO_TCP;
377-
} else
378-
ERR(EAI_PROTOCOL); /*xxx*/
373+
pai->ai_socktype = SOCK_STREAM;
374+
pai->ai_protocol = IPPROTO_TCP;
375+
} else
376+
ERR(EAI_PROTOCOL); /*xxx*/
377+
}
379378
}
380379
}
381380

0 commit comments

Comments
 (0)