guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

01/01: daemon: Allow compilation with GCC 4.9.


From: Ludovic Courtès
Subject: 01/01: daemon: Allow compilation with GCC 4.9.
Date: Mon, 10 Jul 2017 05:56:01 -0400 (EDT)

civodul pushed a commit to branch master
in repository guix.

commit 5c82722cac1dba6cd8f471ca672ff88e04597a55
Author: Ludovic Courtès <address@hidden>
Date:   Mon Jul 10 11:54:25 2017 +0200

    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(-)

diff --git a/nix/nix-daemon/nix-daemon.cc b/nix/nix-daemon/nix-daemon.cc
index b20225b..7d26b61 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;



reply via email to

[Prev in Thread] Current Thread [Next in Thread]