aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/time.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/time.c')
-rw-r--r--kernel/time.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/kernel/time.c b/kernel/time.c
index 804798005d19..2358a3646a63 100644
--- a/kernel/time.c
+++ b/kernel/time.c
@@ -133,12 +133,11 @@ SYSCALL_DEFINE2(gettimeofday, struct timeval __user *, tv,
133 */ 133 */
134static inline void warp_clock(void) 134static inline void warp_clock(void)
135{ 135{
136 write_seqlock_irq(&xtime_lock); 136 struct timespec delta, adjust;
137 wall_to_monotonic.tv_sec -= sys_tz.tz_minuteswest * 60; 137 delta.tv_sec = sys_tz.tz_minuteswest * 60;
138 xtime.tv_sec += sys_tz.tz_minuteswest * 60; 138 delta.tv_nsec = 0;
139 update_xtime_cache(0); 139 adjust = timespec_add_safe(current_kernel_time(), delta);
140 write_sequnlock_irq(&xtime_lock); 140 do_settimeofday(&adjust);
141 clock_was_set();
142} 141}
143 142
144/* 143/*