summaryrefslogtreecommitdiffstats
path: root/contrib/ntp/ntpd/ntp_timer.c
diff options
context:
space:
mode:
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