diff options
author | Mark D. Roth <roth@google.com> | 2016-06-29 07:50:18 -0700 |
---|---|---|
committer | Mark D. Roth <roth@google.com> | 2016-06-29 07:50:18 -0700 |
commit | 89ebe55985a705ddee72d28c1b93cfa681585a8c (patch) | |
tree | f062eab0150ddbdcfd486726aa12955de34c7a57 /src/core/lib/iomgr/unix_sockets_posix.c | |
parent | 07cd9c9e064e636c432500724bf5f91ad15d041a (diff) | |
parent | 76d24420d7a6471dc3b135b62318277991ebdb08 (diff) |
Merge branch 'filter_call_init_failure' into filter_api
Diffstat (limited to 'src/core/lib/iomgr/unix_sockets_posix.c')
-rw-r--r-- | src/core/lib/iomgr/unix_sockets_posix.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/core/lib/iomgr/unix_sockets_posix.c b/src/core/lib/iomgr/unix_sockets_posix.c index 5767c852df..0e7670e5a5 100644 --- a/src/core/lib/iomgr/unix_sockets_posix.c +++ b/src/core/lib/iomgr/unix_sockets_posix.c @@ -47,17 +47,18 @@ void grpc_create_socketpair_if_unix(int sv[2]) { GPR_ASSERT(socketpair(AF_UNIX, SOCK_STREAM, 0, sv) == 0); } -grpc_resolved_addresses *grpc_resolve_unix_domain_address(const char *name) { +grpc_error *grpc_resolve_unix_domain_address(const char *name, + grpc_resolved_addresses **addrs) { struct sockaddr_un *un; - grpc_resolved_addresses *addrs = gpr_malloc(sizeof(grpc_resolved_addresses)); - addrs->naddrs = 1; - addrs->addrs = gpr_malloc(sizeof(grpc_resolved_address)); - un = (struct sockaddr_un *)addrs->addrs->addr; + *addrs = gpr_malloc(sizeof(grpc_resolved_addresses)); + (*addrs)->naddrs = 1; + (*addrs)->addrs = gpr_malloc(sizeof(grpc_resolved_address)); + un = (struct sockaddr_un *)(*addrs)->addrs->addr; un->sun_family = AF_UNIX; strcpy(un->sun_path, name); - addrs->addrs->len = strlen(un->sun_path) + sizeof(un->sun_family) + 1; - return addrs; + (*addrs)->addrs->len = strlen(un->sun_path) + sizeof(un->sun_family) + 1; + return GRPC_ERROR_NONE; } int grpc_is_unix_socket(const struct sockaddr *addr) { |