[Git][NTPsec/ntpsec][master] Restore ntp_error_in_seconds() correctness on platforms without STA_NANO

Matt Selsky gitlab at mg.gitlab.com
Wed Dec 6 15:06:59 UTC 2017


Matt Selsky pushed to branch master at NTPsec / ntpsec


Commits:
4326369d by Matt Selsky at 2017-12-06T09:49:19-05:00
Restore ntp_error_in_seconds() correctness on platforms without STA_NANO

Partially reverts "Address Gitlab issue #422: Build warnings for implicit declaration of function"

- - - - -


1 changed file:

- include/ntp_syscall.h


Changes:

=====================================
include/ntp_syscall.h
=====================================
--- a/include/ntp_syscall.h
+++ b/include/ntp_syscall.h
@@ -13,7 +13,17 @@
 # include <sys/timex.h>
 extern int ntp_adjtime_ns(struct timex *);
 
+/*
+ * The units of the maxerror and esterror fields vary by platform.  If
+ * STA_NANO is defined, they're in nanoseconds; otherwise in
+ * microseconds. Hide the difference by normalizing everything to
+ * float seconds.
+ */
+# ifdef STA_NANO
 #define ntp_error_in_seconds(n)	((n)/1.0e9)
+# else
+#define ntp_error_in_seconds(n)	((n)/1.0e6)
+# endif
 
 /* MUSL port shim */
 #if !defined(HAVE_NTP_ADJTIME) && defined(HAVE_ADJTIMEX)



View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/4326369dd2c7c12f7097da4d26c497cfae2e63ab

---
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/4326369dd2c7c12f7097da4d26c497cfae2e63ab
You're receiving this email because of your account on gitlab.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ntpsec.org/pipermail/vc/attachments/20171206/015763d2/attachment.html>


More information about the vc mailing list