From 5915fe55c0a2e2e3e5ddf079d4d4eb5ece97c0e2 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Tue, 5 Feb 2008 10:20:46 +0000 Subject: [PATCH] listen.c: fix shadow warning here git-svn-id: https://svn.musicpd.org/mpd/trunk@7182 09075e82-0dd4-0310-85a5-a0d7c8717e4f --- src/listen.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/listen.c b/src/listen.c index 91813b4b8..e2b55a5d3 100644 --- a/src/listen.c +++ b/src/listen.c @@ -124,7 +124,7 @@ static void parseListenConfigParam(unsigned int port, ConfigParam * param) { struct sockaddr *addrp; socklen_t addrlen; - struct sockaddr_in sin; + struct sockaddr_in sin4; #ifdef HAVE_IPV6 struct sockaddr_in6 sin6; int useIpv6 = ipv6Supported(); @@ -133,9 +133,9 @@ static void parseListenConfigParam(unsigned int port, ConfigParam * param) sin6.sin6_port = htons(port); sin6.sin6_family = AF_INET6; #endif - memset(&sin, 0, sizeof(struct sockaddr_in)); - sin.sin_port = htons(port); - sin.sin_family = AF_INET; + memset(&sin4, 0, sizeof(struct sockaddr_in)); + sin4.sin_port = htons(port); + sin4.sin_family = AF_INET; if (!param || 0 == strcmp(param->value, "any")) { DEBUG("binding to any address\n"); @@ -148,8 +148,8 @@ static void parseListenConfigParam(unsigned int port, ConfigParam * param) BINDERROR(); } #endif - sin.sin_addr.s_addr = INADDR_ANY; - addrp = (struct sockaddr *)&sin; + sin4.sin_addr.s_addr = INADDR_ANY; + addrp = (struct sockaddr *)&sin4; addrlen = sizeof(struct sockaddr_in); #ifdef HAVE_IPV6 if ((establishListen(port, addrp, addrlen) < 0) && !useIpv6) { @@ -180,9 +180,9 @@ static void parseListenConfigParam(unsigned int port, ConfigParam * param) break; #endif case AF_INET: - memcpy((char *)&sin.sin_addr.s_addr, + memcpy((char *)&sin4.sin_addr.s_addr, (char *)he->h_addr, he->h_length); - addrp = (struct sockaddr *)&sin; + addrp = (struct sockaddr *)&sin4; addrlen = sizeof(struct sockaddr_in); break; default: