[Git][NTPsec/ntpsec][master] Narrow our depenency on nonstandard code.

Eric S. Raymond gitlab at mg.gitlab.com
Sat Aug 26 18:48:56 UTC 2017


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


Commits:
e92a112b by Eric S. Raymond at 2017-08-26T14:48:12-04:00
Narrow our depenency on nonstandard code.

- - - - -


8 changed files:

- include/ntp_net.h
- libntp/isc_interfaceiter.c
- ntpd/ntp_control.c
- ntpd/ntp_io.c
- ntpd/ntp_loopfilter.c
- ntpd/ntp_restrict.c
- ntpd/ntp_sandbox.c
- wscript


Changes:

=====================================
include/ntp_net.h
=====================================
--- a/include/ntp_net.h
+++ b/include/ntp_net.h
@@ -5,6 +5,11 @@
 #ifndef GUARD_NTP_NET_H
 #define GUARD_NTP_NET_H
 
+/* FIXME: GCC/glibc dependency - s6_addr32 member of struct in6_addr. */
+#ifndef _DEFAULT_SOURCE
+# define _DEFAULT_SOURCE 1
+#endif
+
 #include <sys/types.h>
 #include <sys/socket.h>
 #include <net/if.h>


=====================================
libntp/isc_interfaceiter.c
=====================================
--- a/libntp/isc_interfaceiter.c
+++ b/libntp/isc_interfaceiter.c
@@ -7,6 +7,11 @@
 
 #include "config.h"
 
+/* FIXME: GCC/glibc dependency - s6_addr32 member of struct in6_addr. */
+#ifndef _DEFAULT_SOURCE
+# define _DEFAULT_SOURCE 1
+#endif
+
 #include <sys/types.h>
 #include <sys/ioctl.h>
 #ifdef HAVE_SYS_SOCKIO_H


=====================================
ntpd/ntp_control.c
=====================================
--- a/ntpd/ntp_control.c
+++ b/ntpd/ntp_control.c
@@ -5,6 +5,11 @@
 
 #include "config.h"
 
+/* FIXME: GCC/glibc dependency - s6_addr32 member of struct in6_addr. */
+#ifndef _DEFAULT_SOURCE
+# define _DEFAULT_SOURCE 1
+#endif
+
 #include <stdio.h>
 #include <ctype.h>
 #include <sys/stat.h>


=====================================
ntpd/ntp_io.c
=====================================
--- a/ntpd/ntp_io.c
+++ b/ntpd/ntp_io.c
@@ -4,6 +4,11 @@
 
 #include "config.h"
 
+/* FIXME: GCC/glibc dependency - s6_addr32 member of struct in6_addr. */
+#ifndef _DEFAULT_SOURCE
+# define _DEFAULT_SOURCE 1
+#endif
+
 #include <stdio.h>
 #include <signal.h>
 #include <fnmatch.h>


=====================================
ntpd/ntp_loopfilter.c
=====================================
--- a/ntpd/ntp_loopfilter.c
+++ b/ntpd/ntp_loopfilter.c
@@ -6,6 +6,11 @@
  */
 #include "config.h"
 
+/* FIXME: GCC/glibc dependency - s6_addr32 member of struct in6_addr. */
+#ifndef _DEFAULT_SOURCE
+# define _DEFAULT_SOURCE 1
+#endif
+
 #include <limits.h>
 #include <stdio.h>
 #include <ctype.h>


=====================================
ntpd/ntp_restrict.c
=====================================
--- a/ntpd/ntp_restrict.c
+++ b/ntpd/ntp_restrict.c
@@ -4,6 +4,10 @@
 
 #include "config.h"
 
+#ifndef _DEFAULT_SOURCE
+# define _DEFAULT_SOURCE 1
+#endif
+
 #include <stdio.h>
 #include <sys/types.h>
 


=====================================
ntpd/ntp_sandbox.c
=====================================
--- a/ntpd/ntp_sandbox.c
+++ b/ntpd/ntp_sandbox.c
@@ -4,6 +4,11 @@
  * SPDX-License-Identifier: BSD-2-clause
  */
 
+/* FIXME: For some BSD functions related to chroot jailing */
+#ifndef _DEFAULT_SOURCE
+# define _DEFAULT_SOURCE 1
+#endif
+
 #include <stdio.h>
 #include <stdbool.h>
 #include <unistd.h>


=====================================
wscript
=====================================
--- a/wscript
+++ b/wscript
@@ -243,14 +243,14 @@ def configure(ctx):
     #
     # FIXME: We'd like this to be -D_POSIX_C_SOURCE=200809L -D_XOPEN_SOURCE=600
     # rather than -D_GNU_SOURCE, but that runs into problems in two places:
-    # (1) The ISC net handling stuff, where struct in6_addr’ loses a member
+    # (1) The ISC net handling stuff, where struct in6_addr loses a member
     # named s6_addr32 that the macros need, and (2) three BSD functions
     # related to chroot jailing in the sandbox code.
     #
     # Note that _POSIX_C_SOURCE >= 199506L and _GNU_SOURCE both turn on
     # _POSIX_PTHREAD_SEMANTICS and _REENTRANT
     #
-    ctx.env.CFLAGS = ["-std=c99", "-D_GNU_SOURCE"] + ctx.env.CFLAGS
+    ctx.env.CFLAGS = ["-std=c99", "-D_POSIX_C_SOURCE=200809L", "-D_XOPEN_SOURCE=600"] + ctx.env.CFLAGS
 
     msg("--- Configuring main ---")
     ctx.setenv("main", ctx.env.derive())



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

---
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/e92a112b8d8dcaecdbe8a67bcf66cdf81c309798
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/20170826/e707795e/attachment.html>


More information about the vc mailing list