added workaround for ticks being returned as zero from 2.6.32 kernel.

Signed-off-by: Brian Olson <brian@amergint.com>
master
Brian Olson 2017-06-16 12:58:33 -04:00 committed by Richard Cochran
parent ae28f5295f
commit 7c6a9862fd
1 changed files with 1 additions and 1 deletions

View File

@ -73,7 +73,7 @@ double clockadj_get_freq(clockid_t clkid)
pr_err("failed to read out the clock frequency adjustment: %m");
} else {
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);
}
return f;