summaryrefslogtreecommitdiffstats
path: root/xlators
diff options
context:
space:
mode:
authorKotresh HR <khiremat@redhat.com>2019-08-20 15:49:40 +0530
committerRinku Kothiya <rkothiya@redhat.com>2019-08-28 05:49:36 +0000
commitb85d550a552d485f4a7f1eedbc00bdf1f67d6263 (patch)
tree12a0b29cd8cb70404277f2d7e2ad88bc7b89a077 /xlators
parent6ec6db07da2761a35e003ff485f66bae2037c442 (diff)
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. Backport of: > Patch: https://review.gluster.org/23274/ > Change-Id: I57be35ce442d7e05319e82112b687eb4f28d7612 > Signed-off-by: Kotresh HR <khiremat@redhat.com> > BUG: 1743652 (cherry picked from commit d14d0749340d9cb1ef6fc4b35f2fb3015ed0339d) Change-Id: I57be35ce442d7e05319e82112b687eb4f28d7612 Signed-off-by: Kotresh HR <khiremat@redhat.com> fixes: bz#1746145
Diffstat (limited to 'xlators')
-rw-r--r--xlators/features/utime/src/utime-helpers.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/xlators/features/utime/src/utime-helpers.c b/xlators/features/utime/src/utime-helpers.c
index 79cc0145f50..29d9ad93561 100644
--- a/xlators/features/utime/src/utime-helpers.c
+++ b/xlators/features/utime/src/utime-helpers.c
@@ -17,7 +17,7 @@ gl_timespec_get(struct timespec *ts)
#ifdef TIME_UTC
timespec_get(ts, TIME_UTC);
#else
- timespec_now(ts);
+ timespec_now_realtime(ts);
#endif
}