From 5c82722cac1dba6cd8f471ca672ff88e04597a55 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Mon, 10 Jul 2017 11:54:25 +0200 Subject: 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. --- nix/nix-daemon/nix-daemon.cc | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'nix') 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; -- cgit v1.2.3