#endif /* ifdef HAVE_TZSET */
}
-static char unamebuf[BUFSIZ];
-static char *unamep = NULL;
+#ifdef HAVE_UNAME
+static char unamebuf[sizeof(struct utsname)];
+#else
+static const char unamebuf[] = { "unknown architecture" };
+#endif
+static const char *unamep = NULL;
static void
getuname(void) {
snprintf(unamebuf, sizeof(unamebuf), "%s %s %s %s", uts.sysname,
uts.machine, uts.release, uts.version);
-#else /* ifdef HAVE_UNAME */
- snprintf(unamebuf, sizeof(unamebuf), "unknown architecture");
#endif /* ifdef HAVE_UNAME */
unamep = unamebuf;
}
-char *
+const char *
named_os_uname(void) {
if (unamep == NULL) {
getuname();
}
static char unamebuf[BUFSIZ];
-static char *unamep = NULL;
+static const char *unamep = NULL;
static void
getuname(void) {
* GetVersionEx() returns 6.2 (aka Windows 8.1) since it was obsoleted
* so we had to switch to the recommended way to get the Windows version.
*/
-char *
+const char *
named_os_uname(void) {
if (unamep == NULL) {
getuname();