<html lang='en'>
<head>
<meta content='text/html; charset=utf-8' http-equiv='Content-Type'>
<title>
GitLab
</title>
</meta>
</head>
<style>
img {
max-width: 100%;
height: auto;
}
p.details {
font-style:italic;
color:#777
}
.footer p {
font-size:small;
color:#777
}
pre.commit-message {
white-space: pre-wrap;
}
.file-stats a {
text-decoration: none;
}
.file-stats .new-file {
color: #090;
}
.file-stats .deleted-file {
color: #B00;
}
</style>
<body>
<div class='content'>
<h3>
Eric S. Raymond pushed to branch master
at <a href="https://gitlab.com/NTPsec/ntpsec">NTPsec / ntpsec</a>
</h3>
<h4>
Commits:
</h4>
<ul>
<li>
<strong><a href="https://gitlab.com/NTPsec/ntpsec/commit/f6c75eccfe9a2e2d7a9bc56063768e5d3d4ed590">f6c75ecc</a></strong>
<div>
<span>by Juergen Perlinger</span>
<i>at 2016-03-20T16:34:39-04:00</i>
</div>
<pre class='commit-message'>Forward-port from Classic: [Bug 2772] adj_systime overflows tv_usec</pre>
</li>
</ul>
<h4>1 changed file:</h4>
<ul>
<li class='file-stats'>
<a href='#diff-0'>
libntp/systime.c
</a>
</li>
</ul>
<h4>Changes:</h4>
<li id='diff-0'>
<a href='https://gitlab.com/NTPsec/ntpsec/commit/f6c75eccfe9a2e2d7a9bc56063768e5d3d4ed590#diff-0'>
<strong>
libntp/systime.c
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- a/libntp/systime.c
</span><span style="color: #000000;background-color: #ddffdd">+++ b/libntp/systime.c
</span><span style="color: #aaaaaa">@@ -312,9 +312,18 @@ adj_systime(
</span> else
quant = 1e-6;
ticks = (long)(dtemp / quant + .5);
<span style="color: #000000;background-color: #ffdddd">- adjtv.tv_usec = (long)(ticks * quant * 1e6);
- dtemp -= adjtv.tv_usec / 1e6;
- sys_residual = dtemp;
</span><span style="color: #000000;background-color: #ddffdd">+ adjtv.tv_usec = (long)(ticks * quant * 1.e6 + .5);
+ /* The rounding in the conversions could us push over the
+ * limits: make sure the result is properly normalised!
+ * note: sign comes later, all numbers non-negative here.
+ */
+ if (adjtv.tv_usec >= 1000000) {
+ adjtv.tv_sec += 1;
+ adjtv.tv_usec -= 1000000;
+ dtemp -= 1.;
+ }
+ /* set the new residual with leftover from correction */
+ sys_residual = dtemp - adjtv.tv_usec * 1.e-6;
</span>
/*
* Convert to signed seconds and microseconds for the Unix
</code></pre>
<br>
</li>
</div>
<div class='footer' style='margin-top: 10px;'>
<p>
—
<br>
<a href="https://gitlab.com/NTPsec/ntpsec/commit/f6c75eccfe9a2e2d7a9bc56063768e5d3d4ed590">View it on GitLab</a>.
<br>
You're receiving this email because of your account on gitlab.com.
If you'd like to receive fewer emails, you can
adjust your notification settings.
<script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","action":{"@type":"ViewAction","name":"View Commit","url":"https://gitlab.com/NTPsec/ntpsec/commit/f6c75eccfe9a2e2d7a9bc56063768e5d3d4ed590"}}</script>
</p>
</div>
</body>
</html>