From d14d0749340d9cb1ef6fc4b35f2fb3015ed0339d Mon Sep 17 00:00:00 2001 From: Kotresh HR Date: Tue, 20 Aug 2019 15:49:40 +0530 Subject: ctime: Fix incorrect realtime passed to frame->root->ctime On systems that don't support "timespec_get"(e.g., centos6), it was using "clock_gettime" with "CLOCK_MONOTONIC" to get unix epoch time which is incorrect. This patch introduces "timespec_now_realtime" which uses "clock_gettime" with "CLOCK_REALTIME" which fixes the issue. Change-Id: I57be35ce442d7e05319e82112b687eb4f28d7612 Signed-off-by: Kotresh HR fixes: bz#1743652 --- libglusterfs/src/glusterfs/timespec.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'libglusterfs/src/glusterfs') diff --git a/libglusterfs/src/glusterfs/timespec.h b/libglusterfs/src/glusterfs/timespec.h index 871871d538c..bb9ab446a5f 100644 --- a/libglusterfs/src/glusterfs/timespec.h +++ b/libglusterfs/src/glusterfs/timespec.h @@ -21,6 +21,8 @@ void timespec_now(struct timespec *ts); void +timespec_now_realtime(struct timespec *ts); +void timespec_adjust_delta(struct timespec *ts, struct timespec delta); void timespec_sub(const struct timespec *begin, const struct timespec *end, -- cgit