[Git][NTPsec/ntpsec][master] Brain fart in setp_systeim(). Seconds, not nano seconds.
Gary E. Miller
gitlab at mg.gitlab.com
Sat Mar 11 05:29:26 UTC 2017
Gary E. Miller pushed to branch master at NTPsec / ntpsec
Commits:
fd8f7087 by Gary E. Miller at 2017-03-10T21:29:05-08:00
Brain fart in setp_systeim(). Seconds, not nano seconds.
- - - - -
1 changed file:
- libntp/systime.c
Changes:
=====================================
libntp/systime.c
=====================================
--- a/libntp/systime.c
+++ b/libntp/systime.c
@@ -323,7 +323,7 @@ step_systime(
struct timespec ofs_ts; /* desired offset as teimspec */
/* get the complete jump distance as timespec */
- ofs_ts = d_to_tspec((step + sys_residual + 0.5e-9) * 1e9);
+ ofs_ts = d_to_tspec(step + sys_residual + 0.5e-9);
/* ---> time-critical path starts ---> */
@@ -331,10 +331,10 @@ step_systime(
get_ostime(&timets);
/* add offset */
- timets = add_tspec(timets, ofs_ts);
+ tslast = add_tspec(timets, ofs_ts);
/* now set new system time */
- if (settime(&timets) != 0) {
+ if (settime(&tslast) != 0) {
msyslog(LOG_ERR, "step_systime: %m");
return false;
}
@@ -342,8 +342,6 @@ step_systime(
/* <--- time-critical path ended with call to the settime hook <--- */
/* only used for utmp/wtmpx time-step recording */
- tslast.tv_sec = timets.tv_sec;
- tslast.tv_nsec = timets.tv_nsec;
sys_residual = 0;
lamport_violated = (step < 0);
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/fd8f7087ab94c7e9374a48ba7c31a1545b7d0f7c
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ntpsec.org/pipermail/vc/attachments/20170311/8b74a686/attachment.html>
More information about the vc
mailing list