diff options
author | Craig Tiller <ctiller@google.com> | 2016-10-28 07:31:20 -0700 |
---|---|---|
committer | Craig Tiller <ctiller@google.com> | 2016-10-28 07:31:20 -0700 |
commit | fa014a86e3598abf02134189a88c1b8f80c64191 (patch) | |
tree | e0395bf34392dbfa232e6a9b39ae49571b62262d /src/core/lib/iomgr/socket_utils_linux.c | |
parent | 6d4340dda88f6f8771dde54e21620dc32dc4e65a (diff) | |
parent | 6628e36a89b3ec709477b7ff494ec5e237ac8231 (diff) |
Merge github.com:grpc/grpc into pid_ctl
Diffstat (limited to 'src/core/lib/iomgr/socket_utils_linux.c')
-rw-r--r-- | src/core/lib/iomgr/socket_utils_linux.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/src/core/lib/iomgr/socket_utils_linux.c b/src/core/lib/iomgr/socket_utils_linux.c index 144e3110c8..bf6e9e4f55 100644 --- a/src/core/lib/iomgr/socket_utils_linux.c +++ b/src/core/lib/iomgr/socket_utils_linux.c @@ -31,21 +31,27 @@ * */ -#include <grpc/support/port_platform.h> +#include "src/core/lib/iomgr/port.h" -#ifdef GPR_LINUX_SOCKETUTILS +#ifdef GRPC_LINUX_SOCKETUTILS +#include "src/core/lib/iomgr/sockaddr.h" #include "src/core/lib/iomgr/socket_utils_posix.h" +#include <grpc/support/log.h> + #include <sys/socket.h> #include <sys/types.h> -int grpc_accept4(int sockfd, struct sockaddr *addr, socklen_t *addrlen, - int nonblock, int cloexec) { +int grpc_accept4(int sockfd, grpc_resolved_address *resolved_addr, int nonblock, + int cloexec) { int flags = 0; + GPR_ASSERT(sizeof(socklen_t) <= sizeof(size_t)); + GPR_ASSERT(resolved_addr->len <= (socklen_t)-1); flags |= nonblock ? SOCK_NONBLOCK : 0; flags |= cloexec ? SOCK_CLOEXEC : 0; - return accept4(sockfd, addr, addrlen, flags); + return accept4(sockfd, (struct sockaddr *)resolved_addr->addr, + (socklen_t *)&resolved_addr->len, flags); } #endif |