Handle immediate step in local module instead of system driver

This fixes the problem where scheduler wasn't notified about performed
steps and it also makes the command available on all supported systems.
This commit is contained in:
Miroslav Lichvar
2010-01-25 13:07:13 +01:00
parent 52d0c9a057
commit 15e154c09d
7 changed files with 16 additions and 59 deletions

View File

@@ -608,42 +608,6 @@ again:
/* ================================================== */
static void
immediate_step(void)
{
struct timeval old_time, new_time;
struct timezone tz;
long offset;
if (fast_slewing) {
abort_slew();
}
offset = 0;
if (TMX_ApplyOffset(&offset) < 0) {
CROAK("adjtimex() failed in immediate_step");
}
offset_register -= (double) offset / 1.0e6;
slow_slewing = 0;
if (gettimeofday(&old_time, &tz) < 0) {
CROAK("gettimeofday() failed in immediate_step");
}
UTI_AddDoubleToTimeval(&old_time, -offset_register, &new_time);
if (settimeofday(&new_time, &tz) < 0) {
CROAK("settimeofday() failed in immediate_step");
}
offset_register = 0.0;
return;
}
/* ================================================== */
static void
set_leap(int leap)
{
@@ -886,7 +850,7 @@ SYS_Linux_Initialise(void)
lcl_RegisterSystemDrivers(read_frequency, set_frequency,
accrue_offset, apply_step_offset,
get_offset_correction, immediate_step, set_leap);
get_offset_correction, set_leap);
}
/* ================================================== */