summaryrefslogtreecommitdiffstats
path: root/contrib/ntp/ntpd/ntp_timer.c
diff options
context:
space:
mode:
authorRenato Botelho <renato@netgate.com>2016-01-13 17:56:30 -0200
committerRenato Botelho <renato@netgate.com>2016-01-13 17:56:30 -0200
commit3e0bf52f358eb969d165c4b1e54942ee94cf2c8d (patch)
tree440bb9907871a5bc578d65b32f0c4aa339096175 /contrib/ntp/ntpd/ntp_timer.c
parent4b4ac714f11471e43f18410bcc86da8f9dc3b88c (diff)
parente357bdb742b2696dcb81404917b6247f9e840232 (diff)
downloadFreeBSD-src-3e0bf52f358eb969d165c4b1e54942ee94cf2c8d.zip
FreeBSD-src-3e0bf52f358eb969d165c4b1e54942ee94cf2c8d.tar.gz
Merge remote-tracking branch 'origin/stable/10' into devel
Diffstat (limited to 'contrib/ntp/ntpd/ntp_timer.c')
-rw-r--r--contrib/ntp/ntpd/ntp_timer.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/contrib/ntp/ntpd/ntp_timer.c b/contrib/ntp/ntpd/ntp_timer.c
index 828aa8c..03084a3 100644
--- a/contrib/ntp/ntpd/ntp_timer.c
+++ b/contrib/ntp/ntpd/ntp_timer.c
@@ -626,18 +626,19 @@ check_leapsec(
* announce the leap event has happened.
*/
const char *leapmsg = NULL;
- if (lsdata.warped < 0) {
+ double lswarp = lsdata.warped;
+ if (lswarp < 0.0) {
if (clock_max_back > 0.0 &&
- clock_max_back < fabs(lsdata.warped)) {
- step_systime(lsdata.warped);
+ clock_max_back < -lswarp) {
+ step_systime(lswarp);
leapmsg = leapmsg_p_step;
} else {
leapmsg = leapmsg_p_slew;
}
- } else if (lsdata.warped > 0) {
+ } else if (lswarp > 0.0) {
if (clock_max_fwd > 0.0 &&
- clock_max_fwd < fabs(lsdata.warped)) {
- step_systime(lsdata.warped);
+ clock_max_fwd < lswarp) {
+ step_systime(lswarp);
leapmsg = leapmsg_n_step;
} else {
leapmsg = leapmsg_n_slew;
OpenPOWER on IntegriCloud