[Git][NTPsec/ntpsec][master] Address GitLab issue #359: Warning on Solaris with gcc in msyslog.c

Eric S. Raymond gitlab at mg.gitlab.com
Mon Aug 14 03:14:55 UTC 2017


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


Commits:
058574f0 by Eric S. Raymond at 2017-08-13T23:14:23-04:00
Address GitLab issue #359: Warning on Solaris with gcc in msyslog.c

- - - - -


1 changed file:

- libntp/msyslog.c


Changes:

=====================================
libntp/msyslog.c
=====================================
--- a/libntp/msyslog.c
+++ b/libntp/msyslog.c
@@ -10,12 +10,17 @@
 #include <sys/types.h>
 #include <unistd.h>
 #include <stdio.h>
-#include <string.h>
 
 #include "ntp.h"
 #include "ntp_debug.h"
 #include "ntp_syslog.h"
 
+/* Use XSI-compliant strerror_r(3), prototype in string.h.
+ * Don't try moving this further up, else hilarity will ensue...
+ */
+#undef _GNU_SOURCE
+#include <string.h>
+
 /* start out with syslog and stderr, otherwise startup errors lost */
 bool    syslogit = true;        /* log messages to syslog */
 bool    termlogit = true;       /* duplicate to stdout/err */
@@ -91,11 +96,7 @@ errno_to_str(
 	size_t	bufsiz
 	)
 {
-#ifdef _GNU_SOURCE
-	char	*rc;
-#else
 	int rc;
-#endif /* _GNU_SOURCE */
 
 	rc = strerror_r(err, buf, bufsiz);
 	if (rc)



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

---
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/058574f0de25a63b761b6629a1dd62d4b523abb6
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/20170814/73d904be/attachment.html>


More information about the vc mailing list