diff options
author | yang-g <yangg@google.com> | 2017-03-29 10:57:31 -0700 |
---|---|---|
committer | yang-g <yangg@google.com> | 2017-03-29 17:22:19 -0700 |
commit | 07429fa9a6e0e705b8e297bd04ff41786b4f7f7a (patch) | |
tree | 1981d8de836d137b3b52ccef925660ee8372fb30 /src/core/lib | |
parent | 1aba869e9e3046766cab8744a028a20a8af62dd2 (diff) |
Update time_cmp to ignore tv_nsec when tv_sec is INT64 MAX or MIN
Diffstat (limited to 'src/core/lib')
-rw-r--r-- | src/core/lib/support/time.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/core/lib/support/time.c b/src/core/lib/support/time.c index 614a068ddd..c5f94d46f7 100644 --- a/src/core/lib/support/time.c +++ b/src/core/lib/support/time.c @@ -42,7 +42,7 @@ int gpr_time_cmp(gpr_timespec a, gpr_timespec b) { int cmp = (a.tv_sec > b.tv_sec) - (a.tv_sec < b.tv_sec); GPR_ASSERT(a.clock_type == b.clock_type); - if (cmp == 0) { + if (cmp == 0 && a.tv_sec != INT64_MAX && a.tv_sec != INT64_MIN) { cmp = (a.tv_nsec > b.tv_nsec) - (a.tv_nsec < b.tv_nsec); } return cmp; |