From e484aac6f03cc44694f4d6002def46270cdc2479 Mon Sep 17 00:00:00 2001 From: Markus Makela Date: Thu, 22 Sep 2016 10:09:25 +0300 Subject: [PATCH] Use CLOCK_MONOTONIC instead of CLOCK_MONOTONIC_RAW The CLOCK_MONOTONIC_RAW isn't supported on all of the platforms, namely CentOS 5. --- server/core/log_manager.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/server/core/log_manager.cc b/server/core/log_manager.cc index 769445fa2..64bab964a 100644 --- a/server/core/log_manager.cc +++ b/server/core/log_manager.cc @@ -215,10 +215,10 @@ static const int LM_MESSAGE_HASH_SIZE = 293; /** A prime, and roughly a quarter * * @return Current monotonic raw time in milliseconds. */ -static uint64_t time_monotonic_raw_ms() +static uint64_t time_monotonic_ms() { struct timespec now; - clock_gettime(CLOCK_MONOTONIC_RAW, &now); + clock_gettime(CLOCK_MONOTONIC, &now); return now.tv_sec * 1000 + now.tv_nsec / 1000000; } @@ -2815,7 +2815,7 @@ static message_suppression_t message_status(const char* file, int line) { LM_MESSAGE_STATS stats; spinlock_init(&stats.lock); - stats.first_ms = time_monotonic_raw_ms(); + stats.first_ms = time_monotonic_ms(); stats.last_ms = 0; stats.count = 0; @@ -2829,7 +2829,7 @@ static message_suppression_t message_status(const char* file, int line) if (value) { - uint64_t now_ms = time_monotonic_raw_ms(); + uint64_t now_ms = time_monotonic_ms(); spinlock_acquire(&value->lock);