aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2008-04-12 04:07:06 +0000
committerEric Wong <normalperson@yhbt.net>2008-04-12 04:07:06 +0000
commit83e937320b947b4f70600f7517f64ec81c87e289 (patch)
treec76f8afd052b32428613b464789f014892a8d86b /src
parent1b6cf29937514d8d90c7e45b64664d1eb518fcc9 (diff)
downloadmpd-83e937320b947b4f70600f7517f64ec81c87e289.tar.gz
mpd-83e937320b947b4f70600f7517f64ec81c87e289.tar.xz
mpd-83e937320b947b4f70600f7517f64ec81c87e289.zip
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
Diffstat (limited to '')
-rw-r--r--src/listen.c11
1 files 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();
}
}