From 968483ff955513c2bf8a41b56bf8ab5eeea379bc Mon Sep 17 00:00:00 2001 From: vjpai Date: Thu, 24 Mar 2016 09:31:16 -0700 Subject: [PATCH 1/3] Fix the #ifdef to align with the new unix socket ifdef in general --- src/core/surface/init.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/surface/init.c b/src/core/surface/init.c index 233572a9f34..bd58f1d0670 100644 --- a/src/core/surface/init.c +++ b/src/core/surface/init.c @@ -172,7 +172,7 @@ void grpc_init(void) { grpc_register_resolver_type(grpc_dns_resolver_factory_create()); grpc_register_resolver_type(grpc_ipv4_resolver_factory_create()); grpc_register_resolver_type(grpc_ipv6_resolver_factory_create()); -#ifdef GPR_POSIX_SOCKET +#ifdef GPR_HAVE_UNIX_SOCKET grpc_register_resolver_type(grpc_unix_resolver_factory_create()); #endif grpc_register_tracer("api", &grpc_api_trace); From 81dbf84ded56f5f0fe8884e0bc151167fd5bec1c Mon Sep 17 00:00:00 2001 From: Vijay Pai Date: Thu, 24 Mar 2016 10:34:27 -0700 Subject: [PATCH 2/3] Change empty function to an assert since calling this code would be very bad right now. Added a TODO --- src/core/iomgr/unix_sockets_posix_noop.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/core/iomgr/unix_sockets_posix_noop.c b/src/core/iomgr/unix_sockets_posix_noop.c index 045467bea4f..5e797dbdc45 100644 --- a/src/core/iomgr/unix_sockets_posix_noop.c +++ b/src/core/iomgr/unix_sockets_posix_noop.c @@ -35,7 +35,10 @@ #ifndef GPR_HAVE_UNIX_SOCKET -void grpc_create_socketpair_if_unix(int sv[2]) {} +void grpc_create_socketpair_if_unix(int sv[2]) { + // TODO(ahedberg): Please fill in an implementation for non-Unix-sockets case + GPR_ASSERT(0); +} grpc_resolved_addresses *grpc_resolve_unix_domain_address(const char *name) { return NULL; From 761f7bc3e4cb87af5521eae8803d27dbee64c958 Mon Sep 17 00:00:00 2001 From: Vijay Pai Date: Thu, 24 Mar 2016 11:05:48 -0700 Subject: [PATCH 3/3] Fix todo, do not explicitly mark assignment --- src/core/iomgr/unix_sockets_posix_noop.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/core/iomgr/unix_sockets_posix_noop.c b/src/core/iomgr/unix_sockets_posix_noop.c index 5e797dbdc45..d899b46093e 100644 --- a/src/core/iomgr/unix_sockets_posix_noop.c +++ b/src/core/iomgr/unix_sockets_posix_noop.c @@ -36,7 +36,9 @@ #ifndef GPR_HAVE_UNIX_SOCKET void grpc_create_socketpair_if_unix(int sv[2]) { - // TODO(ahedberg): Please fill in an implementation for non-Unix-sockets case + // TODO: Either implement this for the non-Unix socket case or make + // sure that it is never called in any such case. Until then, leave an + // assertion to notify if this gets called inadvertently GPR_ASSERT(0); }