<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/0a01a366d8676d7796dd5cb7e85a0b3b8f328a04">0a01a366</a></strong>
<div>
<span>by Eric S. Raymond</span>
<i>at 2015-12-10T07:10:06Z</i>
</div>
<pre class='commit-message'>Typo fixes in the BUILD file.</pre>
</li>
<li>
<strong><a href="https://gitlab.com/NTPsec/ntpsec/commit/4b306df6aeac4c0243720bcb7316bb28220967a1">4b306df6</a></strong>
<div>
<span>by Eric S. Raymond</span>
<i>at 2015-12-10T08:59:38Z</i>
</div>
<pre class='commit-message'>Port cleanup - move Mac shim for clock_gettime(2) to machines.c.
No logic changes.</pre>
</li>
</ul>
<h4>4 changed files:</h4>
<ul>
<li class='file-stats'>
<a href='#diff-0'>
INSTALL
</a>
</li>
<li class='file-stats'>
<a href='#diff-1'>
include/ntp_unixtime.h
</a>
</li>
<li class='file-stats'>
<a href='#diff-2'>
libntp/machines.c
</a>
</li>
<li class='file-stats'>
<a href='#diff-3'>
libntp/systime.c
</a>
</li>
</ul>
<h4>Changes:</h4>
<li id='diff-0'>
<a href='https://gitlab.com/NTPsec/ntpsec/compare/d1d089535954c1ce04633d08ef005eca86660b55...4b306df6aeac4c0243720bcb7316bb28220967a1#diff-0'>
<strong>
INSTALL
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- a/INSTALL
</span><span style="color: #000000;background-color: #ddffdd">+++ b/INSTALL
</span><span style="color: #aaaaaa">@@ -132,7 +132,7 @@ Please report this as a bug, along with your platform details.
</span>
== Installation Names ==
<span style="color: #000000;background-color: #ffdddd">-By default, `make install' will install the package's files in
</span><span style="color: #000000;background-color: #ddffdd">+By default, `waf install' will install the package's files in
</span> `/usr/local/bin', `/usr/local/man', etc. You can specify an
installation prefix other than `/usr/local' by giving waf the
option `--prefix=PATH'.
<span style="color: #aaaaaa">@@ -141,7 +141,7 @@ option `--prefix=PATH'.
</span>
Due to variations in Perl library paths, our stock source distribution
makes no attempt to install certain Perl scripts: notably
<span style="color: #000000;background-color: #ffdddd">-ntpleapfetch, ntpwait, and ntptrace. If you installed this sotware
</span><span style="color: #000000;background-color: #ddffdd">+ntpleapfetch, ntpwait, and ntptrace. If you installed this software
</span> from a binary package prepared by your OS distributor, the OS
distributor may install them, arranging a rendezvous with the
Perl implementation's library path.
</code></pre>
<br>
</li>
<li id='diff-1'>
<a href='https://gitlab.com/NTPsec/ntpsec/compare/d1d089535954c1ce04633d08ef005eca86660b55...4b306df6aeac4c0243720bcb7316bb28220967a1#diff-1'>
<strong>
include/ntp_unixtime.h
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- a/include/ntp_unixtime.h
</span><span style="color: #000000;background-color: #ddffdd">+++ b/include/ntp_unixtime.h
</span><span style="color: #aaaaaa">@@ -18,22 +18,15 @@
</span> #define CLOCK_REALTIME 0
#define CLOCK_MONOTONIC 1
typedef int clockid_t;
<span style="color: #000000;background-color: #ffdddd">-#endif
-
-#ifndef HAVE_CLOCK_GETTIME
-/*
- * Pacify platforms that don't have a real clock_gettime(2),
- * notably Mac OS X.
- */
</span> int clock_gettime(clockid_t clock_id, struct timespec *tp);
#endif
/*
<span style="color: #000000;background-color: #ffdddd">- * Time of day conversion constant. Ntp's time scale starts in 1900,
</span><span style="color: #000000;background-color: #ddffdd">+ * Time of day conversion constant. NTP's time scale starts in 1900,
</span> * Unix in 1970. The value is 1970 - 1900 in seconds, 0x83aa7e80 or
* 2208988800. This is larger than 32-bit INT_MAX, so unsigned
* type is forced.
*/
#define JAN_1970 ((u_int)NTP_TO_UNIX_DAYS * (u_int)SECSPERDAY)
<span style="color: #000000;background-color: #ffdddd">-#endif /* GUARD_!defined(NTP_UNIXTIME_H) */
</span><span style="color: #000000;background-color: #ddffdd">+#endif /* GUARD_NTP_UNIXTIME_H */
</span></code></pre>
<br>
</li>
<li id='diff-2'>
<a href='https://gitlab.com/NTPsec/ntpsec/compare/d1d089535954c1ce04633d08ef005eca86660b55...4b306df6aeac4c0243720bcb7316bb28220967a1#diff-2'>
<strong>
libntp/machines.c
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- a/libntp/machines.c
</span><span style="color: #000000;background-color: #ddffdd">+++ b/libntp/machines.c
</span><span style="color: #aaaaaa">@@ -26,6 +26,57 @@
</span> int _getch(void); /* Declare the one function rather than include conio.h */
#else
<span style="color: #000000;background-color: #ddffdd">+/*
+ * Simulate ANSI/POSIX conformance on platforms that don't have it
+ */
+#ifndef HAVE_CLOCK_GETTIME
+#ifdef __MACH__
+#include <mach/clock.h>
+#include <mach/mach.h>
+#elif HAVE_GETCLOCK
+#include <sys/timers.h>
+#endif
+
+int clock_gettime(clockid_t clk_id, struct timespec *tp)
+{
+#ifdef __MACH__ // OS X does not have clock_gettime, use clock_get_time
+ clock_serv_t cclock;
+ mach_timespec_t mts;
+ int mode;
+ switch (clk_id) {
+ case CLOCK_REALTIME:
+ mode = CALENDAR_CLOCK;
+ break;
+ case CLOCK_MONOTONIC:
+ /* http://stackoverflow.com/questions/11680461/monotonic-clock-on-osx */
+ mode = SYSTEM_CLOCK;
+ break;
+ default:
+ return -1;
+ }
+ host_get_clock_service(mach_host_self(), mode, &cclock);
+ clock_get_time(cclock, &mts);
+ mach_port_deallocate(mach_task_self(), cclock);
+ tp->tv_sec = mts.tv_sec;
+ tp->tv_nsec = mts.tv_nsec;
+#elif HAVE_GETCLOCK
+ (void) getclock(TIMEOFDAY, &tp);
+#else
+#error Either POSIX clock_gettime(2) or Tru64/HP-UX getclock(2) is required
+/*
+ * Note: as a result of the refactoring of time handing, the support for
+ * compiling ntpdsim is currently broken. It used to have an intercept point
+ * in unixtime.h, these definitions:
+ #define GETTIMEOFDAY(a, b) (node_gettime(&ntp_node, a))
+ #define SETTIMEOFDAY(a, b) (node_settime(&ntp_node, a))
+ #define ADJTIMEOFDAY(a, b) (node_adjtime(&ntp_node, a, b))
+ * To work again it will need one here.
+ */
+#endif
+ return 0;
+}
+#endif /* HAVE_CLOCK_GETTIME */
+
</span> #if !defined(HAVE_NTP_GETTIME) && defined(HAVE_NTP_ADJTIME)
int ntp_gettime(struct ntptimeval *ntv)
{
</code></pre>
<br>
</li>
<li id='diff-3'>
<a href='https://gitlab.com/NTPsec/ntpsec/compare/d1d089535954c1ce04633d08ef005eca86660b55...4b306df6aeac4c0243720bcb7316bb28220967a1#diff-3'>
<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">@@ -115,57 +115,6 @@ init_systime(void)
</span>
#ifndef SIM /* ntpsim.c has get_systime() and friends for sim */
<span style="color: #000000;background-color: #ffdddd">-/*
- * Simulate ANSI/POSIX conformance on platforms that don't have it
- */
-#ifndef HAVE_CLOCK_GETTIME
-#ifdef __MACH__
-#include <mach/clock.h>
-#include <mach/mach.h>
-#elif HAVE_GETCLOCK
-#include <sys/timers.h>
-#endif
-
-int clock_gettime(clockid_t clk_id, struct timespec *tp)
-{
-#ifdef __MACH__ // OS X does not have clock_gettime, use clock_get_time
- clock_serv_t cclock;
- mach_timespec_t mts;
- int mode;
- switch (clk_id) {
- case CLOCK_REALTIME:
- mode = CALENDAR_CLOCK;
- break;
- case CLOCK_MONOTONIC:
- /* http://stackoverflow.com/questions/11680461/monotonic-clock-on-osx */
- mode = SYSTEM_CLOCK;
- break;
- default:
- return -1;
- }
- host_get_clock_service(mach_host_self(), mode, &cclock);
- clock_get_time(cclock, &mts);
- mach_port_deallocate(mach_task_self(), cclock);
- tp->tv_sec = mts.tv_sec;
- tp->tv_nsec = mts.tv_nsec;
-#elif HAVE_GETCLOCK
- (void) getclock(TIMEOFDAY, &tp);
-#else
-#error Either POSIX clock_gettime(2) or Tru64/HP-UX getclock(2) is required
-/*
- * Note: as a result of the refactoring of time handing, the support for
- * compiling ntpdsim is currently broken. It used to have an intercept point
- * in unixtime.h, these definitions:
- #define GETTIMEOFDAY(a, b) (node_gettime(&ntp_node, a))
- #define SETTIMEOFDAY(a, b) (node_settime(&ntp_node, a))
- #define ADJTIMEOFDAY(a, b) (node_adjtime(&ntp_node, a, b))
- * To work again it will need one here.
- */
-#endif
- return 0;
-}
-#endif /* HAVE_CLOCK_GETTIME */
-
</span> void
get_ostime(
struct timespec * tsp
</code></pre>
<br>
</li>
</div>
<div class='footer' style='margin-top: 10px;'>
<p>
—
<br>
<a href="https://gitlab.com/NTPsec/ntpsec/compare/d1d089535954c1ce04633d08ef005eca86660b55...4b306df6aeac4c0243720bcb7316bb28220967a1">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.
</p>
</div>
</body>
</html>