summaryrefslogtreecommitdiff
path: root/librabbitmq/amqp_timer.c
diff options
context:
space:
mode:
authorAlan Antonuk <alan.antonuk@gmail.com>2013-06-18 16:11:32 -0700
committerAlan Antonuk <alan.antonuk@gmail.com>2013-06-18 16:11:32 -0700
commit01e38dd4d0db62e66b23e867f84b7b8da2533556 (patch)
tree9fda8ba4f2720248d220a91b9e1fbb50d216b340 /librabbitmq/amqp_timer.c
parent52a459bc28233859ce99549e1bb71c7804e5cb82 (diff)
downloadrabbitmq-c-github-ask-01e38dd4d0db62e66b23e867f84b7b8da2533556.tar.gz
FIX: handle mach_timebase_info failure
Diffstat (limited to 'librabbitmq/amqp_timer.c')
-rw-r--r--librabbitmq/amqp_timer.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/librabbitmq/amqp_timer.c b/librabbitmq/amqp_timer.c
index aa7f6d4..026661a 100644
--- a/librabbitmq/amqp_timer.c
+++ b/librabbitmq/amqp_timer.c
@@ -70,6 +70,9 @@ amqp_get_monotonic_timestamp(void)
if (s_timebase.denom == 0) {
mach_timebase_info(&s_timebase);
+ if (0 == s_timebase.denom) {
+ return 0;
+ }
}
timestamp = timestamp * s_timebase.numer / s_timebase.denom;