[Git][NTPsec/ntpsec][master] 3 commits: Fix a comment

Hal Murray gitlab at mg.gitlab.com
Fri Oct 4 20:28:48 UTC 2019



Hal Murray pushed to branch master at NTPsec / ntpsec


Commits:
5822e613 by Richard Laager at 2019-10-04T19:27:39Z
Fix a comment

IEEE Std 1003.1-2017 says:
Since this volume of POSIX.1-2017 is aligned with the ISO C standard,
and since all functionality enabled by _POSIX_C_SOURCE set equal to
200809L is enabled by _XOPEN_SOURCE set equal to 700, there should be
no need to define _POSIX_C_SOURCE if _XOPEN_SOURCE is so defined.
Therefore, if _XOPEN_SOURCE is set equal to 700 and _POSIX_C_SOURCE is
set equal to 200809L, the behavior is the same as if only _XOPEN_SOURCE
is defined and set equal to 700. However, should _POSIX_C_SOURCE be set
to a value greater than 200809L, the behavior is unspecified.

- - - - -
7b709a1d by Richard Laager at 2019-10-04T19:27:39Z
Rename mystrerror() to ntp_strerror_r()

This is a wrapper around strerror_r(), not strerror(), so it should have
an _r() at the end.  Also, ntp_strerror_r() is more consistent with
other wrapper functions and just better "namespacing" than "my".

- - - - -
38cef835 by Richard Laager at 2019-10-04T19:27:39Z
Replace all strerror_r() with ntp_strerror_r()

- - - - -


10 changed files:

- devel/hacking.adoc
- include/ntp_stdlib.h
- libntp/isc_interfaceiter.c
- libntp/isc_net.c
- libntp/msyslog.c
- ntpd/nts.c
- ntpd/nts_client.c
- ntpd/nts_cookie.c
- ntpd/nts_server.c
- wscript


Changes:

=====================================
devel/hacking.adoc
=====================================
@@ -77,13 +77,9 @@ POSIX threads *are* considered part of the standardized API, but their
 use requires extreme care.  The main part of ntpd assumes it is the only
 thread.  One interesting area is msyslog.  The DNS thread doesn't call msyslog.
 That was impractical for NTS, so msyslog is thread safe as of 2019-Apr.
-Beware of calling strerror() from non-main threads.  Use strerror_r()
-into a buffer on the stack.  Similarly, use socktoa_r() and sockporttoa_r()
-and don't call lib_getbuf() or refclock_name().
-
-Actually, don't use strerror_r() since our build environment
-has troubles getting a consistent version of the API.
-Use mystrerror() until we clean this up.
+Beware of calling strerror() from non-main threads.  Use ntp_strerror_r() into
+a buffer on the stack.  Similarly, use socktoa_r() and sockporttoa_r() and
+don't call lib_getbuf() or refclock_name().
 
 You *may* assume the clock_gettime(2) and clock_settime(2) calls, and
 the related getitimer(2)/setitimer(2), from POSIX-1.2008.


=====================================
include/ntp_stdlib.h
=====================================
@@ -29,7 +29,7 @@
 extern const char *ntpd_version(void);
 
 extern	void	msyslog(int, const char *, ...) NTP_PRINTF(2, 3);
-extern	void	mystrerror(int errnum, char *buf, size_t buflen);
+extern	void	ntp_strerror_r(int errnum, char *buf, size_t buflen);
 extern	void	init_logging	(const char *, uint32_t, int);
 extern	int	change_logfile	(const char *, bool);
 extern	void	reopen_logfile  (void);


=====================================
libntp/isc_interfaceiter.c
=====================================
@@ -258,7 +258,7 @@ isc_interfaceiter_create(isc_mem_t *mctx, isc_interfaceiter_t **iterp) {
         if (!seenv6) {
                 iter->proc = fopen("/proc/net/if_inet6", "r");
                 if (iter->proc == NULL) {
-			IGNORE(strerror_r(errno, strbuf, sizeof(strbuf)));
+			ntp_strerror_r(errno, strbuf, sizeof(strbuf));
 /*                      isc_log_write(isc_lctx, ISC_LOGCATEGORY_GENERAL,
                                       ISC_LOGMODULE_SOCKET, ISC_LOG_WARNING,
                                       "failed to open /proc/net/if_inet6");
@@ -277,7 +277,7 @@ isc_interfaceiter_create(isc_mem_t *mctx, isc_interfaceiter_t **iterp) {
                         break;
         }
         if (ret < 0) {
-		IGNORE(strerror_r(errno, strbuf, sizeof(strbuf)));
+		ntp_strerror_r(errno, strbuf, sizeof(strbuf));
                 msyslog(LOG_ERR, "getting interface addresses: getifaddrs: %s",
                                  strbuf);
                 result = ISC_R_UNEXPECTED;
@@ -525,7 +525,7 @@ isc_interfaceiter_create(isc_mem_t *mctx, isc_interfaceiter_t **iterp) {
          */
         bufsize = 0;
         if (sysctl(mib, 6, NULL, &bufsize, NULL, (size_t) 0) < 0) {
-                strerror_r(errno, strbuf, sizeof(strbuf));
+                ntp_strerror_r(errno, strbuf, sizeof(strbuf));
                 msyslog(LOG_ERR, "getting interface list size: sysctl: %s",
                                  strbuf);
                 result = ISC_R_UNEXPECTED;
@@ -541,7 +541,7 @@ isc_interfaceiter_create(isc_mem_t *mctx, isc_interfaceiter_t **iterp) {
 
         bufused = bufsize;
         if (sysctl(mib, 6, iter->buf, &bufused, NULL, (size_t) 0) < 0) {
-                strerror_r(errno, strbuf, sizeof(strbuf));
+                ntp_strerror_r(errno, strbuf, sizeof(strbuf));
                 msyslog(LOG_ERR, "getting interface list: sysctl: %s",
                                  strbuf);
                 result = ISC_R_UNEXPECTED;
@@ -848,7 +848,7 @@ getbuf4(isc_interfaceiter_t *iter) {
                 if (isc_ioctl(iter->socket, SIOCGIFCONF, (char *)&iter->ifc)
                     == -1) {
                         if (errno != EINVAL) {
-                                strerror_r(errno, strbuf, sizeof(strbuf));
+                                ntp_strerror_r(errno, strbuf, sizeof(strbuf));
                                 msyslog(LOG_ERR, "get interface "
                                                  "configuration: %s",
                                                  strbuf);
@@ -918,7 +918,7 @@ getbuf6(isc_interfaceiter_t *iter) {
                 if (isc_ioctl(iter->socket6, SIOCGLIFCONF, (char *)&iter->lifc)
                     == -1) {
                         if (errno != EINVAL) {
-                                strerror_r(errno, strbuf, sizeof(strbuf));
+                                ntp_strerror_r(errno, strbuf, sizeof(strbuf));
                                 msyslog(LOG_ERR, "get interface "
                                                  "configuration: %s",
                                                  strbuf);
@@ -1004,7 +1004,7 @@ isc_interfaceiter_create(isc_mem_t *mctx, isc_interfaceiter_t **iterp) {
                  * SIOCGLIFCONF to get IPv6 addresses.
                  */
                 if ((iter->socket6 = socket(AF_INET6, SOCK_DGRAM, 0)) < 0) {
-                        strerror_r(errno, strbuf, sizeof(strbuf));
+                        ntp_strerror_r(errno, strbuf, sizeof(strbuf));
                         msyslog(LOG_ERR, "making interface scan socket: %s",
                                          strbuf);
                         result = ISC_R_UNEXPECTED;
@@ -1016,7 +1016,7 @@ isc_interfaceiter_create(isc_mem_t *mctx, isc_interfaceiter_t **iterp) {
         }
 #endif
         if ((iter->socket = socket(AF_INET, SOCK_DGRAM, 0)) < 0) {
-                strerror_r(errno, strbuf, sizeof(strbuf));
+                ntp_strerror_r(errno, strbuf, sizeof(strbuf));
                 msyslog(LOG_ERR, "making interface scan socket: %s",
                                  strbuf);
                 result = ISC_R_UNEXPECTED;
@@ -1139,7 +1139,7 @@ internal_current4(isc_interfaceiter_t *iter) {
          * and is really hard to shut up.
          */
         if (isc_ioctl(iter->socket, SIOCGIFFLAGS, (char *) &ifreq) < 0) {
-                strerror_r(errno, strbuf, sizeof(strbuf));
+                ntp_strerror_r(errno, strbuf, sizeof(strbuf));
                 msyslog(LOG_ERR, "%s: getting interface flags: %s",
                                  ifreq.ifr_name, strbuf);
                 return (ISC_R_IGNORE);
@@ -1174,7 +1174,7 @@ internal_current4(isc_interfaceiter_t *iter) {
                sizeof(iter->current.address.type.in6));
 
         if (isc_ioctl(iter->socket, SIOCGLIFADDR, &lifreq) < 0) {
-                strerror_r(errno, strbuf, sizeof(strbuf));
+                ntp_strerror_r(errno, strbuf, sizeof(strbuf));
                 msyslog(LOG_ERR, "%s: getting interface address: %s",
                                  ifreq.ifr_name, strbuf);
                 return (ISC_R_IGNORE);
@@ -1213,7 +1213,7 @@ internal_current4(isc_interfaceiter_t *iter) {
                  */
                 if (isc_ioctl(iter->socket, SIOCGIFDSTADDR, (char *)&ifreq)
                     < 0) {
-                        strerror_r(errno, strbuf, sizeof(strbuf));
+                        ntp_strerror_r(errno, strbuf, sizeof(strbuf));
                         msyslog(LOG_ERR, "%s: getting destination address: %s",
                                          ifreq.ifr_name, strbuf);
                         return (ISC_R_IGNORE);
@@ -1231,7 +1231,7 @@ internal_current4(isc_interfaceiter_t *iter) {
                  */
                 if (isc_ioctl(iter->socket, SIOCGIFBRDADDR, (char *)&ifreq)
                     < 0) {
-                        strerror_r(errno, strbuf, sizeof(strbuf));
+                        ntp_strerror_r(errno, strbuf, sizeof(strbuf));
                         msyslog(LOG_ERR, "%s: getting broadcast address: %s",
                                          ifreq.ifr_name, strbuf);
                         return (ISC_R_IGNORE);
@@ -1251,7 +1251,7 @@ internal_current4(isc_interfaceiter_t *iter) {
          * and is really hard to shut up.
          */
         if (isc_ioctl(iter->socket, SIOCGIFNETMASK, (char *)&ifreq) < 0) {
-                strerror_r(errno, strbuf, sizeof(strbuf));
+                ntp_strerror_r(errno, strbuf, sizeof(strbuf));
                 msyslog(LOG_ERR, "%s: getting netmask: %s",
                                  ifreq.ifr_name, strbuf);
                 return (ISC_R_IGNORE);
@@ -1331,7 +1331,7 @@ internal_current6(isc_interfaceiter_t *iter) {
          * and is really hard to shut up.
          */
         if (isc_ioctl(fd, SIOCGLIFFLAGS, (char *) &lifreq) < 0) {
-                strerror_r(errno, strbuf, sizeof(strbuf));
+                ntp_strerror_r(errno, strbuf, sizeof(strbuf));
                 msyslog(LOG_ERR, "%s: getting interface flags: %s",
                                  lifreq.lifr_name, strbuf);
                 return (ISC_R_IGNORE);
@@ -1370,7 +1370,7 @@ internal_current6(isc_interfaceiter_t *iter) {
                  */
                 if (isc_ioctl(fd, SIOCGLIFDSTADDR, (char *)&lifreq)
                     < 0) {
-                        strerror_r(errno, strbuf, sizeof(strbuf));
+                        ntp_strerror_r(errno, strbuf, sizeof(strbuf));
                         msyslog(LOG_ERR, "%s: getting destination address: %s",
                                          lifreq.lifr_name, strbuf);
                         return (ISC_R_IGNORE);
@@ -1390,7 +1390,7 @@ internal_current6(isc_interfaceiter_t *iter) {
                  */
                 if (isc_ioctl(iter->socket, SIOCGLIFBRDADDR, (char *)&lifreq)
                     < 0) {
-                        strerror_r(errno, strbuf, sizeof(strbuf));
+                        ntp_strerror_r(errno, strbuf, sizeof(strbuf));
                         msyslog(LOG_ERR, "%s: getting broadcast address: %s",
                                          lifreq.lifr_name, strbuf);
                         return (ISC_R_IGNORE);
@@ -1434,7 +1434,7 @@ internal_current6(isc_interfaceiter_t *iter) {
          * and is really hard to shut up.
          */
         if (isc_ioctl(fd, SIOCGLIFNETMASK, (char *)&lifreq) < 0) {
-                strerror_r(errno, strbuf, sizeof(strbuf));
+                ntp_strerror_r(errno, strbuf, sizeof(strbuf));
                 msyslog(LOG_ERR, "%s: getting netmask: %s",
                                  lifreq.lifr_name, strbuf);
                 return (ISC_R_IGNORE);


=====================================
libntp/isc_net.c
=====================================
@@ -53,7 +53,7 @@ try_proto(int domain) {
 #endif
 			return (ISC_R_NOTFOUND);
 		default:
-			IGNORE(strerror_r(errno, strbuf, sizeof(strbuf)));
+			ntp_strerror_r(errno, strbuf, sizeof(strbuf));
 			msyslog(LOG_ERR, "socket() failed: %s", strbuf);
 			return (ISC_R_UNEXPECTED);
 		}
@@ -156,7 +156,7 @@ initialize_ipv6only(void) {
 	/* check for TCP sockets */
 	s = socket(PF_INET6, SOCK_STREAM, 0);
 	if (s == -1) {
-		IGNORE(strerror_r(errno, strbuf, sizeof(strbuf)));
+		ntp_strerror_r(errno, strbuf, sizeof(strbuf));
 		msyslog(LOG_ERR, "socket() failed: %s", strbuf);
 		ipv6only_result = ISC_R_UNEXPECTED;
 		return;
@@ -173,7 +173,7 @@ initialize_ipv6only(void) {
 	/* check for UDP sockets */
 	s = socket(PF_INET6, SOCK_DGRAM, 0);
 	if (s == -1) {
-	    IGNORE(strerror_r(errno, strbuf, sizeof(strbuf)));
+		ntp_strerror_r(errno, strbuf, sizeof(strbuf));
 		msyslog(LOG_ERR, "socket() failed: %s", strbuf);
 		ipv6only_result = ISC_R_UNEXPECTED;
 		return;


=====================================
libntp/msyslog.c
=====================================
@@ -13,6 +13,7 @@
 
 #include "ntp.h"
 #include "ntp_debug.h"
+#include "ntp_stdlib.h"
 #include "ntp_syslog.h"
 #include "lib_strbuf.h"
 
@@ -448,7 +449,7 @@ reopen_logfile(void)
 }
 
 /* Hack because there are 2 APIs to strerror_r()  */
-void mystrerror(int errnum, char *buf, size_t buflen) {
+void ntp_strerror_r(int errnum, char *buf, size_t buflen) {
 #ifdef STRERROR_CHAR
 	char *answer = strerror_r(errnum, buf, buflen);
 	if (answer != buf) {


=====================================
ntpd/nts.c
=====================================
@@ -260,7 +260,7 @@ int nts_ssl_read(SSL *ssl, uint8_t *buff, int buff_length) {
 	char errbuf[100];
 	bytes_read = SSL_read(ssl, buff, buff_length);
 	if (0 >= bytes_read) {
-		mystrerror(errno, errbuf, sizeof(errbuf));
+		ntp_strerror_r(errno, errbuf, sizeof(errbuf));
 		msyslog(LOG_INFO, "NTS: SSL_read error: %s", errbuf);
 		nts_log_ssl_error();
 		return -1;
@@ -273,7 +273,7 @@ int nts_ssl_write(SSL *ssl, uint8_t *buff, int buff_length) {
 	char errbuf[100];
 	bytes_written = SSL_write(ssl, buff, buff_length);
 	if (0 >= bytes_written) {
-		mystrerror(errno, errbuf, sizeof(errbuf));
+		ntp_strerror_r(errno, errbuf, sizeof(errbuf));
 		msyslog(LOG_INFO, "NTS: SSL_write error: %s", errbuf);
 		nts_log_ssl_error();
 		return -1;


=====================================
ntpd/nts_client.c
=====================================
@@ -29,6 +29,7 @@
 #include "nts.h"
 #include "nts2.h"
 #include "ntp_dns.h"
+#include "ntp_stdlib.h"
 
 SSL_CTX* make_ssl_client_ctx(const char *filename);
 int open_TCP_socket(struct peer *peer, const char *hostname);
@@ -104,7 +105,7 @@ bool nts_probe(struct peer * peer) {
 
 	err = setsockopt(server, SOL_SOCKET, SO_RCVTIMEO, &timeout, sizeof(timeout));
 	if (0 > err) {
-		mystrerror(errno, errbuf, sizeof(errbuf));
+		ntp_strerror_r(errno, errbuf, sizeof(errbuf));
 		msyslog(LOG_ERR, "NTSc: can't setsockopt: %s", errbuf);
 		close(server);
 		nts_ke_probes_bad++;
@@ -295,13 +296,13 @@ int open_TCP_socket(struct peer *peer, const char *hostname) {
 
 	sockfd = socket(answer->ai_family, SOCK_STREAM, 0);
 	if (-1 == sockfd) {
-		mystrerror(errno, errbuf, sizeof(errbuf));
+		ntp_strerror_r(errno, errbuf, sizeof(errbuf));
 		msyslog(LOG_INFO, "NTSc: nts_probe: no socket: %s", errbuf);
 	} else {
 		// Use first answer
 		err = connect(sockfd, answer->ai_addr, answer->ai_addrlen);
 		if (-1 == err) {
-			mystrerror(errno, errbuf, sizeof(errbuf));
+			ntp_strerror_r(errno, errbuf, sizeof(errbuf));
 			msyslog(LOG_INFO, "NTSc: nts_probe: connect failed: %s", errbuf);
 			close(sockfd);
 			sockfd = -1;
@@ -502,7 +503,7 @@ bool nts_client_send_request_core(uint8_t *buff, int buf_size, int *used, struct
 
 	*used = buf_size-buf.left;
 	if (*used >= (int)(buf_size - 10)) {
-		mystrerror(errno, errbuf, sizeof(errbuf));
+		ntp_strerror_r(errno, errbuf, sizeof(errbuf));
 		msyslog(LOG_ERR, "NTSc: write failed: %d, %ld, %s",
 			*used, (long)buf_size, errbuf);
 		return false;
@@ -683,7 +684,7 @@ bool nts_set_cert_search(SSL_CTX *ctx, const char *filename) {
 			filename, statbuf.st_mode);
 		return false;
 	}
-	mystrerror(errno, errbuf, sizeof(errbuf));
+	ntp_strerror_r(errno, errbuf, sizeof(errbuf));
 	msyslog(LOG_ERR, "NTSc: can't stat cert dir/file: %s, %s",
 		ntsconfig.ca, errbuf);
 	return false;


=====================================
ntpd/nts_cookie.c
=====================================
@@ -169,7 +169,7 @@ bool nts_read_cookie_keys(void) {
 		char errbuf[100];
 		if (ENOENT == errno)
 			return false;		/* File doesn't exist */
-		mystrerror(errno, errbuf, sizeof(errbuf));
+		ntp_strerror_r(errno, errbuf, sizeof(errbuf));
 		msyslog(LOG_ERR, "NTSs: can't read old cookie file: %s=>%s",
 			cookie_filename, errbuf);
 		exit(1);
@@ -252,13 +252,13 @@ bool nts_write_cookie_keys(void) {
 		cookie_filename = ntsconfig.KI;
 	fd = open(cookie_filename, O_CREAT|O_WRONLY, S_IRUSR|S_IWUSR);
 	if (-1 == fd) {
-		mystrerror(errno, errbuf, sizeof(errbuf));
+		ntp_strerror_r(errno, errbuf, sizeof(errbuf));
 		msyslog(LOG_ERR, "ERR: can't open %s: %s", cookie_filename, errbuf);
 		return false;
 	}
 	out = fdopen(fd, "w");
 	if (NULL == out) {
-		mystrerror(errno, errbuf, sizeof(errbuf));
+		ntp_strerror_r(errno, errbuf, sizeof(errbuf));
 		msyslog(LOG_ERR, "ERR: can't fdopen %s: %s", cookie_filename, errbuf);
 		close(fd);
 		return false;


=====================================
ntpd/nts_server.c
=====================================
@@ -142,14 +142,14 @@ bool nts_server_init2(void) {
 	if (listener4_sock != -1) {
 		rc = pthread_create(&worker, NULL, nts_ke_listener, &listener4_sock);
 		if (rc) {
-			mystrerror(errno, errbuf, sizeof(errbuf));
+			ntp_strerror_r(errno, errbuf, sizeof(errbuf));
 			msyslog(LOG_ERR, "NTSs: nts_start_server4: error from pthread_create: %s", errbuf);
 		}
 	}
 	if (listener6_sock != -1) {
 		rc = pthread_create(&worker, NULL, nts_ke_listener, &listener6_sock);
 		if (rc) {
-			mystrerror(errno, errbuf, sizeof(errbuf));
+			ntp_strerror_r(errno, errbuf, sizeof(errbuf));
 			msyslog(LOG_ERR, "NTSs: nts_start_server6: error from pthread_create: %s", errbuf);
 		}
 	}
@@ -195,7 +195,7 @@ void* nts_ke_listener(void* arg) {
 
 		client = accept(sock, &addr.sa, &len);
 		if (client < 0) {
-			mystrerror(errno, errbuf, sizeof(errbuf));
+			ntp_strerror_r(errno, errbuf, sizeof(errbuf));
 			msyslog(LOG_ERR, "NTSs: TCP accept failed: %s", errbuf);
 			if (EBADF == errno)
 				return NULL;
@@ -208,7 +208,7 @@ void* nts_ke_listener(void* arg) {
 		msyslog(LOG_INFO, "NTSs: TCP accept-ed from %s", errbuf);
 		err = setsockopt(client, SOL_SOCKET, SO_RCVTIMEO, &timeout, sizeof(timeout));
 		if (0 > err) {
-			mystrerror(errno, errbuf, sizeof(errbuf));
+			ntp_strerror_r(errno, errbuf, sizeof(errbuf));
 			msyslog(LOG_ERR, "NTSs: can't setsockopt: %s", errbuf);
 			close(client);
 			nts_ke_serves_bad++;
@@ -318,26 +318,26 @@ bool create_listener4(int port) {
 			msyslog(LOG_ERR, "NTSs: No IPv4 support, disabling NTS-KE listener");
 			return true;
 		}
-		mystrerror(errno, errbuf, sizeof(errbuf));
+		ntp_strerror_r(errno, errbuf, sizeof(errbuf));
 		msyslog(LOG_ERR, "NTSs: Can't create socket4: %s", errbuf);
 		return false;
 	}
 	err = setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on));
 	if (0 > err) {
-		mystrerror(errno, errbuf, sizeof(errbuf));
+		ntp_strerror_r(errno, errbuf, sizeof(errbuf));
 		msyslog(LOG_ERR, "NTSs: can't setsockopt4: %s", errbuf);
 		close(sock);
 		return false;
 	}
 	err = bind(sock, &addr.sa, sizeof(addr.sa4));
 	if (0 > err) {
-		mystrerror(errno, errbuf, sizeof(errbuf));
+		ntp_strerror_r(errno, errbuf, sizeof(errbuf));
 		msyslog(LOG_ERR, "NTSs: can't bind4: %s", errbuf);
 		close(sock);
 		return false;
 	}
 	if (listen(sock, 6) < 0) {
-		mystrerror(errno, errbuf, sizeof(errbuf));
+		ntp_strerror_r(errno, errbuf, sizeof(errbuf));
 		msyslog(LOG_ERR, "NTSs: can't listen4: %s", errbuf);
 		close(sock);
 		return false;
@@ -364,34 +364,34 @@ bool create_listener6(int port) {
 			msyslog(LOG_ERR, "NTSs: No IPv6 support, disabling NTS-KE listener");
 			return true;
 		}
-		mystrerror(errno, errbuf, sizeof(errbuf));
+		ntp_strerror_r(errno, errbuf, sizeof(errbuf));
 		msyslog(LOG_ERR, "NTSs: Can't create socket6: %s", errbuf);
 		return false;
 	}
 	/* Hack to keep IPV6 from listening on IPV4 too */
 	err = setsockopt(sock, IPPROTO_IPV6, IPV6_V6ONLY, &on, sizeof(on));
 	if (0 > err) {
-		mystrerror(errno, errbuf, sizeof(errbuf));
+		ntp_strerror_r(errno, errbuf, sizeof(errbuf));
 		msyslog(LOG_ERR, "NTSs: can't setsockopt6only: %s", errbuf);
 		close(sock);
 		return false;
 	}
 	err = setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on));
 	if (0 > err) {
-		mystrerror(errno, errbuf, sizeof(errbuf));
+		ntp_strerror_r(errno, errbuf, sizeof(errbuf));
 		msyslog(LOG_ERR, "NTSs: can't setsockopt6: %s", errbuf);
 		close(sock);
 		return false;
 	}
 	err = bind(sock, &addr.sa, sizeof(addr.sa6));
 	if (0 > err) {
-		mystrerror(errno, errbuf, sizeof(errbuf));
+		ntp_strerror_r(errno, errbuf, sizeof(errbuf));
 		msyslog(LOG_ERR, "NTSs: can't bind6: %s", errbuf);
 		close(sock);
 		return false;
 	}
 	if (listen(sock, 6) < 0) {
-		mystrerror(errno, errbuf, sizeof(errbuf));
+		ntp_strerror_r(errno, errbuf, sizeof(errbuf));
 		msyslog(LOG_ERR, "NTSs: can't listen6: %s", errbuf);
 		close(sock);
 		return false;


=====================================
wscript
=====================================
@@ -243,7 +243,7 @@ def configure(ctx):
     #      if >=200112L, all of IEEE 1003.1-2004
     #      if >=200809L, all of IEEE 1003.1-2008
     #
-    # FIXME: We'd like this to be -D_POSIX_C_SOURCE=200809L -D_XOPEN_SOURCE=600
+    # FIXME: We'd like this to be -D_POSIX_C_SOURCE=200809L -D_XOPEN_SOURCE=700
     # 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
     # named s6_addr32 that the macros need, and (2) three BSD functions



View it on GitLab: https://gitlab.com/NTPsec/ntpsec/compare/9873e7b25657df955ec50efe1dc55ecb7547145f...38cef835ff28a84dcd4a217d0900441ca3eec544

-- 
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/compare/9873e7b25657df955ec50efe1dc55ecb7547145f...38cef835ff28a84dcd4a217d0900441ca3eec544
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/20191004/b0abef99/attachment-0001.htm>


More information about the vc mailing list