[Git][NTPsec/ntpsec][master] Remove a fossil from an ol d port hack.

Eric S. Raymond gitlab at mg.gitlab.com
Thu Jun 16 10:58:29 UTC 2016


Eric S. Raymond pushed to branch master at NTPsec / ntpsec


Commits:
d8c77f78 by Eric S. Raymond at 2016-06-16T06:52:52-04:00
Remove a fossil from an ol d port hack.

Some driver files had the following code snuppet in them:

extern int async_write(int, const void *, unsigned int);

Specifically, refclock_acts.c, refclock_arbiter.c, refclock_dumbclock.c,
refclock_hopfser.c, refclock_nmea.c, refclock_palisade.c, refclock_true.c.

However, many more drivers use write(2) without redefining it, and all
run synchronously. I conclude that this snippet is unecessary and was
copied blindly from an early example.  Perhaps it was a performance hack.

- - - - -


7 changed files:

- ntpd/refclock_acts.c
- ntpd/refclock_arbiter.c
- ntpd/refclock_dumbclock.c
- ntpd/refclock_hopfser.c
- ntpd/refclock_nmea.c
- ntpd/refclock_palisade.c
- ntpd/refclock_true.c


Changes:

=====================================
ntpd/refclock_acts.c
=====================================
--- a/ntpd/refclock_acts.c
+++ b/ntpd/refclock_acts.c
@@ -17,12 +17,6 @@
 # include <sys/ioctl.h>
 #endif /* HAVE_SYS_IOCTL_H */
 
-#ifdef SYS_WINNT
-#undef write	/* ports/winnt/include/config.h: #define write _write */
-extern int async_write(int, const void *, unsigned int);
-#define write(fd, data, octets)	async_write(fd, data, octets)
-#endif
-
 /*
  * This driver supports the US (NIST, USNO) and European (PTB, NPL,
  * etc.) modem time services, as well as Spectracom GPS


=====================================
ntpd/refclock_arbiter.c
=====================================
--- a/ntpd/refclock_arbiter.c
+++ b/ntpd/refclock_arbiter.c
@@ -13,12 +13,6 @@
 #include <stdio.h>
 #include <ctype.h>
 
-#ifdef SYS_WINNT
-extern int async_write(int, const void *, unsigned int);
-#undef write
-#define write(fd, data, octets)	async_write(fd, data, octets)
-#endif
-
 /*
  * This driver supports the Arbiter 1088A/B Satellite Controlled Clock.
  * The claimed accuracy of this clock is 100 ns relative to the PPS


=====================================
ntpd/refclock_dumbclock.c
=====================================
--- a/ntpd/refclock_dumbclock.c
+++ b/ntpd/refclock_dumbclock.c
@@ -19,12 +19,6 @@
 #include <stdio.h>
 #include <ctype.h>
 
-#ifdef SYS_WINNT
-extern int async_write(int, const void *, unsigned int);
-#undef write
-#define write(fd, data, octets)	async_write(fd, data, octets)
-#endif
-
 /*
  * This driver supports a generic dumb clock that only outputs hh:mm:ss,
  * in local time, no less.


=====================================
ntpd/refclock_hopfser.c
=====================================
--- a/ntpd/refclock_hopfser.c
+++ b/ntpd/refclock_hopfser.c
@@ -20,12 +20,6 @@
 
 #include <termios.h>
 
-#ifdef SYS_WINNT
-extern int async_write(int, const void *, unsigned int);
-#undef write
-#define write(fd, data, octets)	async_write(fd, data, octets)
-#endif
-
 /*
  * clock definitions
  */


=====================================
ntpd/refclock_nmea.c
=====================================
--- a/ntpd/refclock_nmea.c
+++ b/ntpd/refclock_nmea.c
@@ -319,14 +319,7 @@ static void     save_ltc        (struct refclockproc * const, const char * const
  * support functions by defining NMEA_WRITE_SUPPORT to non-zero...
  */
 #if NMEA_WRITE_SUPPORT
-
 static	void gps_send(int, const char *, struct peer *);
-# ifdef SYS_WINNT
-#  undef write	/* ports/winnt/include/config.h: #define write _write */
-extern int async_write(int, const void *, unsigned int);
-#  define write(fd, data, octets)	async_write(fd, data, octets)
-# endif /* SYS_WINNT */
-
 #endif /* NMEA_WRITE_SUPPORT */
 
 static int32_t g_gpsMinBase;


=====================================
ntpd/refclock_palisade.c
=====================================
--- a/ntpd/refclock_palisade.c
+++ b/ntpd/refclock_palisade.c
@@ -44,12 +44,6 @@
 # include <sys/ioctl.h>
 #endif /* not HAVE_SYS_IOCTL_H */
 
-#ifdef SYS_WINNT
-extern int async_write(int, const void *, unsigned int);
-#undef write
-#define write(fd, data, octets)	async_write(fd, data, octets)
-#endif
-
 #include "refclock_palisade.h"
 /* Table to get from month to day of the year */
 const int days_of_year [12] = {


=====================================
ntpd/refclock_true.c
=====================================
--- a/ntpd/refclock_true.c
+++ b/ntpd/refclock_true.c
@@ -15,12 +15,6 @@
 #include "ntp_stdlib.h"
 #include "ntp_control.h"	/* for CTL_* clocktypes */
 
-#ifdef SYS_WINNT
-extern int async_write(int, const void *, unsigned int);
-#undef write
-#define write(fd, data, octets)	async_write(fd, data, octets)
-#endif
-
 /* This should be an atom clock but those are very hard to build.
  *
  * The PCL720 from P C Labs has an Intel 8253 lookalike, as well as a bunch



View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/d8c77f78993adfd74d5bff1e520c8ca89b73d520
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ntpsec.org/pipermail/vc/attachments/20160616/acfd2ea6/attachment.html>


More information about the vc mailing list