mirror of
https://github.com/isc-projects/bind9.git
synced 2026-06-09 01:02:05 -04:00
Merge branch '1965-bin-named-unix-os-c-warning-s-directive-output-may-be-truncated-on-openindiana' into 'main'
Resolve "bin/named/unix/os.c warning: '%s' directive output may be truncated on OpenIndiana" Closes #1965 See merge request isc-projects/bind9!3737
This commit is contained in:
commit
6d5fde62a3
4 changed files with 11 additions and 9 deletions
|
|
@ -73,7 +73,7 @@ named_os_tzset(void);
|
|||
void
|
||||
named_os_started(void);
|
||||
|
||||
char *
|
||||
const char *
|
||||
named_os_uname(void);
|
||||
|
||||
#endif /* NAMED_OS_H */
|
||||
|
|
|
|||
|
|
@ -903,8 +903,12 @@ named_os_tzset(void) {
|
|||
#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) {
|
||||
|
|
@ -919,13 +923,11 @@ 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();
|
||||
|
|
|
|||
|
|
@ -70,7 +70,7 @@ named_os_tzset(void);
|
|||
void
|
||||
named_os_started(void);
|
||||
|
||||
char *
|
||||
const char *
|
||||
named_os_uname(void);
|
||||
|
||||
#endif /* NAMED_OS_H */
|
||||
|
|
|
|||
|
|
@ -393,7 +393,7 @@ named_os_started(void) {
|
|||
}
|
||||
|
||||
static char unamebuf[BUFSIZ];
|
||||
static char *unamep = NULL;
|
||||
static const char *unamep = NULL;
|
||||
|
||||
static void
|
||||
getuname(void) {
|
||||
|
|
@ -462,7 +462,7 @@ err:
|
|||
* 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();
|
||||
|
|
|
|||
Loading…
Reference in a new issue