From 83e937320b947b4f70600f7517f64ec81c87e289 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sat, 12 Apr 2008 04:07:06 +0000 Subject: [PATCH] eliminate unused parameters The parameter "port" is not actually used by establishListen(), and can be removed. This also allows establishListen() to be used for socket addresses which have no port. git-svn-id: https://svn.musicpd.org/mpd/trunk@7233 09075e82-0dd4-0310-85a5-a0d7c8717e4f --- src/listen.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/listen.c b/src/listen.c index 918bdb4aa..a22427095 100644 --- a/src/listen.c +++ b/src/listen.c @@ -67,8 +67,7 @@ static void redirect_stdin(void) FATAL("dup2 stdin: %s\n", strerror(errno)); } -static int establishListen(unsigned int port, - struct sockaddr *addrp, socklen_t addrlen) +static int establishListen(struct sockaddr *addrp, socklen_t addrlen) { int pf; int sock; @@ -144,7 +143,7 @@ static void parseListenConfigParam(unsigned int port, ConfigParam * param) sin6.sin6_addr = in6addr_any; addrp = (struct sockaddr *)&sin6; addrlen = sizeof(struct sockaddr_in6); - if (establishListen(port, addrp, addrlen) < 0) + if (establishListen(addrp, addrlen) < 0) BINDERROR(); } #endif @@ -152,9 +151,9 @@ static void parseListenConfigParam(unsigned int port, ConfigParam * param) addrp = (struct sockaddr *)&sin4; addrlen = sizeof(struct sockaddr_in); #ifdef HAVE_IPV6 - if ((establishListen(port, addrp, addrlen) < 0) && !useIpv6) { + if ((establishListen(addrp, addrlen) < 0) && !useIpv6) { #else - if (establishListen(port, addrp, addrlen) < 0) { + if (establishListen(addrp, addrlen) < 0) { #endif BINDERROR(); } @@ -190,7 +189,7 @@ static void parseListenConfigParam(unsigned int port, ConfigParam * param) "at line %i\n", param->value, param->line); } - if (establishListen(port, addrp, addrlen) < 0) + if (establishListen(addrp, addrlen) < 0) BINDERROR(); } }