mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-11-07 07:26:13 -05:00
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
1 changed files with 2 additions and 4 deletions
|
@ -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 a new issue