added workaround for ticks being returned as zero from 2.6.32 kernel.
Signed-off-by: Brian Olson <brian@amergint.com>master
parent
ae28f5295f
commit
7c6a9862fd
|
@ -73,7 +73,7 @@ double clockadj_get_freq(clockid_t clkid)
|
||||||
pr_err("failed to read out the clock frequency adjustment: %m");
|
pr_err("failed to read out the clock frequency adjustment: %m");
|
||||||
} else {
|
} else {
|
||||||
f = tx.freq / 65.536;
|
f = tx.freq / 65.536;
|
||||||
if (clkid == CLOCK_REALTIME && realtime_nominal_tick)
|
if (clkid == CLOCK_REALTIME && realtime_nominal_tick && tx.tick)
|
||||||
f += 1e3 * realtime_hz * (tx.tick - realtime_nominal_tick);
|
f += 1e3 * realtime_hz * (tx.tick - realtime_nominal_tick);
|
||||||
}
|
}
|
||||||
return f;
|
return f;
|
||||||
|
|
Loading…
Reference in New Issue