From 157879d4f67c2af4495a7f0a8d145de6bac98dc2 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Fri, 8 Nov 2013 13:38:41 +0100 Subject: sock: in listen_sock(), move variable for setsockopt() into scope Signed-off-by: Michael Adam --- src/sock.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/sock.c b/src/sock.c index 23ebd13..9510fa2 100644 --- a/src/sock.c +++ b/src/sock.c @@ -170,7 +170,6 @@ int listen_sock (const char *addr, uint16_t port, vector_t listen_fds) { struct addrinfo hints, *result, *rp; char portstr[6]; - const int on = 1; int ret = -1; 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) { int listenfd; int lret; + const int on = 1; char numerichost[NI_MAXHOST]; int flags = NI_NUMERICHOST; -- cgit v1.2.3