aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/iomgr/resolve_address_posix.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/iomgr/resolve_address_posix.c')
-rw-r--r--src/core/iomgr/resolve_address_posix.c16
1 files changed, 2 insertions, 14 deletions
diff --git a/src/core/iomgr/resolve_address_posix.c b/src/core/iomgr/resolve_address_posix.c
index 0360ab717c..ef193c02ec 100644
--- a/src/core/iomgr/resolve_address_posix.c
+++ b/src/core/iomgr/resolve_address_posix.c
@@ -39,9 +39,6 @@
#include <string.h>
#include <sys/types.h>
-#ifdef GPR_HAVE_UNIX_SOCKET
-#include <sys/un.h>
-#endif
#include <grpc/support/alloc.h>
#include <grpc/support/host_port.h>
@@ -53,6 +50,7 @@
#include "src/core/iomgr/executor.h"
#include "src/core/iomgr/iomgr_internal.h"
#include "src/core/iomgr/sockaddr_utils.h"
+#include "src/core/iomgr/unix_posix_sockets.h"
#include "src/core/support/block_annotate.h"
#include "src/core/support/string.h"
@@ -73,21 +71,11 @@ static grpc_resolved_addresses *blocking_resolve_address_impl(
int s;
size_t i;
grpc_resolved_addresses *addrs = NULL;
-#ifdef GPR_HAVE_UNIX_SOCKET
- struct sockaddr_un *un;
if (name[0] == 'u' && name[1] == 'n' && name[2] == 'i' && name[3] == 'x' &&
name[4] == ':' && name[5] != 0) {
- 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 + 5);
- addrs->addrs->len = strlen(un->sun_path) + sizeof(un->sun_family) + 1;
- return addrs;
+ return grpc_resolve_unix_domain_address(name + 5);
}
-#endif
/* parse name, splitting it into host and port parts */
gpr_split_host_port(name, &host, &port);