diff options
Diffstat (limited to 'kernel/time')
-rw-r--r-- | kernel/time/ntp.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/kernel/time/ntp.c b/kernel/time/ntp.c index ed8cfdf16983..5ac593267a26 100644 --- a/kernel/time/ntp.c +++ b/kernel/time/ntp.c | |||
@@ -648,6 +648,17 @@ int do_adjtimex(struct timex *txc) | |||
648 | hrtimer_cancel(&leap_timer); | 648 | hrtimer_cancel(&leap_timer); |
649 | } | 649 | } |
650 | 650 | ||
651 | if (txc->modes & ADJ_SETOFFSET) { | ||
652 | struct timespec delta; | ||
653 | if ((unsigned long)txc->time.tv_usec >= NSEC_PER_SEC) | ||
654 | return -EINVAL; | ||
655 | delta.tv_sec = txc->time.tv_sec; | ||
656 | delta.tv_nsec = txc->time.tv_usec; | ||
657 | if (!(txc->modes & ADJ_NANO)) | ||
658 | delta.tv_nsec *= 1000; | ||
659 | timekeeping_inject_offset(&delta); | ||
660 | } | ||
661 | |||
651 | getnstimeofday(&ts); | 662 | getnstimeofday(&ts); |
652 | 663 | ||
653 | write_seqlock_irq(&xtime_lock); | 664 | write_seqlock_irq(&xtime_lock); |