summaryrefslogtreecommitdiff
path: root/ext/socket/getnameinfo.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/socket/getnameinfo.c')
-rw-r--r--ext/socket/getnameinfo.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/ext/socket/getnameinfo.c b/ext/socket/getnameinfo.c
index aee81b5..a77faf9 100644
--- a/ext/socket/getnameinfo.c
+++ b/ext/socket/getnameinfo.c
@@ -135,7 +135,6 @@ int
getnameinfo(const struct sockaddr *sa, size_t salen, char *host, size_t hostlen, char *serv, size_t servlen, int flags)
{
struct afd *afd;
- struct servent *sp;
struct hostent *hp;
u_short port;
int family, len, i;
@@ -177,7 +176,7 @@ getnameinfo(const struct sockaddr *sa, size_t salen, char *host, size_t hostlen,
strcpy(serv, numserv);
} else {
#if defined(HAVE_GETSERVBYPORT)
- sp = getservbyport(port, (flags & NI_DGRAM) ? "udp" : "tcp");
+ struct servent *sp = getservbyport(port, (flags & NI_DGRAM) ? "udp" : "tcp");
if (sp) {
if (strlen(sp->s_name) + 1 > servlen)
return ENI_MEMORY;