Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 74158
b: refs/heads/master
c: 52bfb36
h: refs/heads/master
v: v3
  • Loading branch information
John Stultz authored and Ingo Molnar committed Nov 26, 2007
1 parent dbce20c commit fc4dd33
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8232fd625217dc641ed05dd238a8bb5c82828082
refs/heads/master: 52bfb36050c8529d9031d2c2513b281a360922ec
1 change: 1 addition & 0 deletions trunk/include/linux/timex.h
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ struct timex {
#define ADJ_TIMECONST 0x0020 /* pll time constant */
#define ADJ_TICK 0x4000 /* tick value */
#define ADJ_OFFSET_SINGLESHOT 0x8001 /* old-fashioned adjtime */
#define ADJ_OFFSET_SS_READ 0xa001 /* read-only adjtime */

/* xntp 3.4 compatibility names */
#define MOD_OFFSET ADJ_OFFSET
Expand Down
9 changes: 6 additions & 3 deletions trunk/kernel/time/ntp.c
Original file line number Diff line number Diff line change
Expand Up @@ -249,10 +249,12 @@ int do_adjtimex(struct timex *txc)

/* Now we validate the data before disabling interrupts */

if ((txc->modes & ADJ_OFFSET_SINGLESHOT) == ADJ_OFFSET_SINGLESHOT)
if ((txc->modes & ADJ_OFFSET_SINGLESHOT) == ADJ_OFFSET_SINGLESHOT) {
/* singleshot must not be used with any other mode bits */
if (txc->modes != ADJ_OFFSET_SINGLESHOT)
if (txc->modes != ADJ_OFFSET_SINGLESHOT &&
txc->modes != ADJ_OFFSET_SS_READ)
return -EINVAL;
}

if (txc->modes != ADJ_OFFSET_SINGLESHOT && (txc->modes & ADJ_OFFSET))
/* adjustment Offset limited to +- .512 seconds */
Expand Down Expand Up @@ -372,7 +374,8 @@ int do_adjtimex(struct timex *txc)
leave: if ((time_status & (STA_UNSYNC|STA_CLOCKERR)) != 0)
result = TIME_ERROR;

if ((txc->modes & ADJ_OFFSET_SINGLESHOT) == ADJ_OFFSET_SINGLESHOT)
if ((txc->modes == ADJ_OFFSET_SINGLESHOT) ||
(txc->modes == ADJ_OFFSET_SS_READ))
txc->offset = save_adjust;
else
txc->offset = ((long)shift_right(time_offset, SHIFT_UPDATE)) *
Expand Down

0 comments on commit fc4dd33

Please sign in to comment.