From 2f4d3088b5d2984a9ead2d24d4d9997068a6ccca Mon Sep 17 00:00:00 2001
From: Adrien Destugues <pulkomandy@gmail.com>
Date: Fri, 17 Oct 2014 11:03:53 +0200
Subject: build fixes.


diff --git a/configure.ac b/configure.ac
index 682023b..3efa39b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -613,7 +613,7 @@ AM_CONDITIONAL(CHECK_WITH_FASTCGI, test "x$fastcgi_found" = xyes)
 
 dnl check for extra compiler options (warning options)
 if test "${GCC}" = "yes"; then
-    CFLAGS="${CFLAGS} -Wall -W -Wshadow -pedantic -std=gnu99"
+    CFLAGS="${CFLAGS} -Wall -W -Wshadow -pedantic -std=gnu9x"
 fi
 
 AC_ARG_ENABLE(extra-warnings,
diff --git a/src/network.c b/src/network.c
index ebde43b..d5e843d 100644
--- a/src/network.c
+++ b/src/network.c
@@ -356,15 +356,15 @@ static int network_server_init(server *srv, buffer *host_token, specific_config
 				goto error_free_socket;
 			}
 			memcpy(srv_socket->addr.un.sun_path, host, hostlen);
-		}
-		srv_socket->addr.un.sun_family = AF_UNIX;
+			srv_socket->addr.un.sun_family = AF_UNIX;
 
 #ifdef SUN_LEN
-		addr_len = SUN_LEN(&srv_socket->addr.un);
+			addr_len = SUN_LEN(&srv_socket->addr.un);
 #else
-		/* stevens says: */
-		addr_len = hostlen + sizeof(srv_socket->addr.un.sun_family);
+			/* stevens says: */
+			addr_len = hostlen + sizeof(srv_socket->addr.un.sun_family);
 #endif
+		}
 
 		/* check if the socket exists and try to connect to it. */
 		if (-1 != (fd = connect(srv_socket->fd, (struct sockaddr *) &(srv_socket->addr), addr_len))) {
-- 
1.8.3.4

