summary refs log tree commit diff
diff options
context:
space:
mode:
authorLudovic Courtès <ludovic.courtes@inria.fr>2017-07-10 11:54:25 +0200
committerLudovic Courtès <ludo@gnu.org>2017-07-10 11:55:54 +0200
commit5c82722cac1dba6cd8f471ca672ff88e04597a55 (patch)
treef6547488f62961dba8b095c429b7e3fd949b791b
parenteb737a271a14fb436d46c2968b5d0069032985fd (diff)
downloadguix-5c82722cac1dba6cd8f471ca672ff88e04597a55.tar.gz
daemon: Allow compilation with GCC 4.9.
Reported by Ricardo Wurmus.

* nix/nix-daemon/nix-daemon.cc (acceptConnection): Remove intermediate
'inaddr' variables that relied on implicit casts.  This fixes
compilation with GCC 4.9.
-rw-r--r--nix/nix-daemon/nix-daemon.cc6
1 files changed, 2 insertions, 4 deletions
diff --git a/nix/nix-daemon/nix-daemon.cc b/nix/nix-daemon/nix-daemon.cc
index b20225b3b0..7d26b61354 100644
--- a/nix/nix-daemon/nix-daemon.cc
+++ b/nix/nix-daemon/nix-daemon.cc
@@ -887,13 +887,11 @@ static void acceptConnection(int fdSocket)
 
 	    if (remoteAddr.ss_family == AF_INET) {
 		struct sockaddr_in *addr = (struct sockaddr_in *) &remoteAddr;
-		struct in_addr inaddr = { addr->sin_addr };
-		result = inet_ntop(AF_INET, &inaddr,
+		result = inet_ntop(AF_INET, &addr->sin_addr,
 				   address_str, sizeof address_str);
 	    } else if (remoteAddr.ss_family == AF_INET6) {
 		struct sockaddr_in6 *addr = (struct sockaddr_in6 *) &remoteAddr;
-		struct in6_addr inaddr = { addr->sin6_addr };
-		result = inet_ntop(AF_INET6, &inaddr,
+		result = inet_ntop(AF_INET6, &addr->sin6_addr,
 				   address_str, sizeof address_str);
 	    } else {
 		result = NULL;