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
This commit is contained in:
parent
1b6cf29937
commit
83e937320b
11
src/listen.c
11
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();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user