diff options
author | Craig Tiller <craig.tiller@gmail.com> | 2015-07-20 14:04:18 -0700 |
---|---|---|
committer | Craig Tiller <craig.tiller@gmail.com> | 2015-07-20 14:04:18 -0700 |
commit | 81bcc4caba6fb137c306b818ca0acfe3692c31ff (patch) | |
tree | a4347dcf232671ff2a9d9bae401c1118d5cef406 /src/core/client_config/resolvers | |
parent | 1b22b9db94784bc589d372e2b30eb939d009c3d9 (diff) |
Make endpoint peer API work on Windows
Diffstat (limited to 'src/core/client_config/resolvers')
-rw-r--r-- | src/core/client_config/resolvers/sockaddr_resolver.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/core/client_config/resolvers/sockaddr_resolver.c b/src/core/client_config/resolvers/sockaddr_resolver.c index d42f8b1798..74584e7e2c 100644 --- a/src/core/client_config/resolvers/sockaddr_resolver.c +++ b/src/core/client_config/resolvers/sockaddr_resolver.c @@ -37,7 +37,9 @@ #include <stdio.h> #include <string.h> +#ifdef GPR_POSIX_SOCKET #include <sys/un.h> +#endif #include <grpc/support/alloc.h> #include <grpc/support/host_port.h> @@ -172,7 +174,7 @@ static int parse_ipv4(grpc_uri *uri, struct sockaddr_storage *addr, int *len) { memset(in, 0, sizeof(*in)); *len = sizeof(*in); in->sin_family = AF_INET; - if (inet_aton(host, &in->sin_addr) == 0) { + if (inet_pton(AF_INET, host, &in->sin_addr) == 0) { gpr_log(GPR_ERROR, "invalid ipv4 address: '%s'", host); goto done; } |