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.
This commit is contained in:
parent
eb737a271a
commit
5c82722cac
|
@ -887,13 +887,11 @@ static void acceptConnection(int fdSocket)
|
||||||
|
|
||||||
if (remoteAddr.ss_family == AF_INET) {
|
if (remoteAddr.ss_family == AF_INET) {
|
||||||
struct sockaddr_in *addr = (struct sockaddr_in *) &remoteAddr;
|
struct sockaddr_in *addr = (struct sockaddr_in *) &remoteAddr;
|
||||||
struct in_addr inaddr = { addr->sin_addr };
|
result = inet_ntop(AF_INET, &addr->sin_addr,
|
||||||
result = inet_ntop(AF_INET, &inaddr,
|
|
||||||
address_str, sizeof address_str);
|
address_str, sizeof address_str);
|
||||||
} else if (remoteAddr.ss_family == AF_INET6) {
|
} else if (remoteAddr.ss_family == AF_INET6) {
|
||||||
struct sockaddr_in6 *addr = (struct sockaddr_in6 *) &remoteAddr;
|
struct sockaddr_in6 *addr = (struct sockaddr_in6 *) &remoteAddr;
|
||||||
struct in6_addr inaddr = { addr->sin6_addr };
|
result = inet_ntop(AF_INET6, &addr->sin6_addr,
|
||||||
result = inet_ntop(AF_INET6, &inaddr,
|
|
||||||
address_str, sizeof address_str);
|
address_str, sizeof address_str);
|
||||||
} else {
|
} else {
|
||||||
result = NULL;
|
result = NULL;
|
||||||
|
|
Loading…
Reference in New Issue