|
@@ -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 */
|
|
@@ -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)) *
|