diff options
author | 2017-03-20 09:35:39 -0700 | |
---|---|---|
committer | 2017-03-20 09:35:39 -0700 | |
commit | 18e15064849b9b5c85f28ea9e8f0e56c059fb57b (patch) | |
tree | 53e8e9a7e69e87ca319b42488c04870ee3eefee2 /src/core/lib/iomgr/timer_generic.c | |
parent | bd0af4fc6cad1f4d9b371e5cea19cf5c91d8c8c2 (diff) |
Fix uninitialized variable
Diffstat (limited to 'src/core/lib/iomgr/timer_generic.c')
-rw-r--r-- | src/core/lib/iomgr/timer_generic.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/core/lib/iomgr/timer_generic.c b/src/core/lib/iomgr/timer_generic.c index d52613e713..048cf3dc78 100644 --- a/src/core/lib/iomgr/timer_generic.c +++ b/src/core/lib/iomgr/timer_generic.c @@ -422,13 +422,17 @@ bool grpc_timer_check(grpc_exec_ctx *exec_ctx, gpr_timespec now, gpr_timespec *next) { GPR_ASSERT(now.clock_type == g_clock_type); gpr_atm now_atm = timespec_to_atm_round_down(now); - gpr_atm next_atm; - bool r = run_some_expired_timers( - exec_ctx, now_atm, &next_atm, + grpc_error *shutdown_error = gpr_time_cmp(now, gpr_inf_future(now.clock_type)) != 0 ? GRPC_ERROR_NONE - : GRPC_ERROR_CREATE("Shutting down timer system")); - if (next != NULL) *next = atm_to_timespec(next_atm); + : GRPC_ERROR_CREATE("Shutting down timer system"); + if (next == NULL) { + r = run_some_expired_timers(exec_ctx, now_atm, NULL, shutdown_error); + } else { + gpr_atm next_atm = timespec_to_atm_round_down(*next); + r = run_some_expired_timers(exec_ctx, now_atm, &next_atm, shutdown_error); + *next = atm_to_timespec(next_atm); + } return r; } |