sock: in listen_sock(), move variable for setsockopt() into scope

Signed-off-by: Michael Adam <obnox@samba.org>
(cherry picked from commit 157879d4f6)
This commit is contained in:
Michael Adam 2013-11-08 13:38:41 +01:00
parent 37ffa6986d
commit 4f600654d2

View File

@ -170,7 +170,6 @@ int listen_sock (const char *addr, uint16_t port, vector_t listen_fds)
{ {
struct addrinfo hints, *result, *rp; struct addrinfo hints, *result, *rp;
char portstr[6]; char portstr[6];
const int on = 1;
int ret = -1; int ret = -1;
assert (port > 0); assert (port > 0);
@ -193,6 +192,7 @@ int listen_sock (const char *addr, uint16_t port, vector_t listen_fds)
for (rp = result; rp != NULL; rp = rp->ai_next) { for (rp = result; rp != NULL; rp = rp->ai_next) {
int listenfd; int listenfd;
int lret; int lret;
const int on = 1;
char numerichost[NI_MAXHOST]; char numerichost[NI_MAXHOST];
int flags = NI_NUMERICHOST; int flags = NI_NUMERICHOST;