diff options
author | Craig Tiller <ctiller@google.com> | 2016-04-13 08:45:06 -0700 |
---|---|---|
committer | Craig Tiller <ctiller@google.com> | 2016-04-13 08:45:06 -0700 |
commit | fc98f926101b28ee8bd1241bab96173c6bbebf20 (patch) | |
tree | 624a2a299cdf657505396d1491c200be03866492 /src/core | |
parent | c2b6a0bcf98fb3d153e319a4be255da8540977c8 (diff) |
API fuzzer
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/ext/transport/chttp2/client/insecure/channel_create.c | 4 | ||||
-rw-r--r-- | src/core/lib/support/time_posix.c | 8 |
2 files changed, 10 insertions, 2 deletions
diff --git a/src/core/ext/transport/chttp2/client/insecure/channel_create.c b/src/core/ext/transport/chttp2/client/insecure/channel_create.c index 0ed115793b..c5d3d8d9cc 100644 --- a/src/core/ext/transport/chttp2/client/insecure/channel_create.c +++ b/src/core/ext/transport/chttp2/client/insecure/channel_create.c @@ -235,5 +235,7 @@ grpc_channel *grpc_insecure_channel_create(const char *target, grpc_exec_ctx_finish(&exec_ctx); - return channel; /* may be NULL */ + return channel != NULL ? channel : grpc_lame_client_channel_create( + target, GRPC_STATUS_INTERNAL, + "Failed to create client channel"); } diff --git a/src/core/lib/support/time_posix.c b/src/core/lib/support/time_posix.c index f5f62dadc6..cc0aa2b476 100644 --- a/src/core/lib/support/time_posix.c +++ b/src/core/lib/support/time_posix.c @@ -78,7 +78,7 @@ static const clockid_t clockid_for_gpr_clock[] = {CLOCK_MONOTONIC, void gpr_time_init(void) { gpr_precise_clock_init(); } -gpr_timespec gpr_now(gpr_clock_type clock_type) { +static gpr_timespec now_impl(gpr_clock_type clock_type) { struct timespec now; GPR_ASSERT(clock_type != GPR_TIMESPAN); if (clock_type == GPR_CLOCK_PRECISE) { @@ -95,6 +95,12 @@ gpr_timespec gpr_now(gpr_clock_type clock_type) { return gpr_from_timespec(now, clock_type); } } + +gpr_timespec (*gpr_now_impl)(gpr_clock_type clock_type) = now_impl; + +gpr_timespec gpr_now(gpr_clock_type clock_type) { + return gpr_now_impl(clock_type); +} #else /* For some reason Apple's OSes haven't implemented clock_gettime. */ |