diff options
author | Nathan Scott <nathans@redhat.com> | 2021-03-04 09:00:34 +1100 |
---|---|---|
committer | Nathan Scott <nathans@redhat.com> | 2021-03-04 13:44:40 +1100 |
commit | adaf748ab6e779fdf53706448bb31718f098f6d5 (patch) | |
tree | 4de3ca3bcbc77be2cc9f9987b8bbcdf50cae1df8 /generic | |
parent | 61ef1134d97dbcf8b4ee069b36addf3c706ff55c (diff) |
Fix include file ordering of generic headers
Diffstat (limited to 'generic')
-rw-r--r-- | generic/hostname.h | 1 | ||||
-rw-r--r-- | generic/openzfs_sysctl.h | 1 | ||||
-rw-r--r-- | generic/uname.c | 9 |
3 files changed, 7 insertions, 4 deletions
diff --git a/generic/hostname.h b/generic/hostname.h index c6b941e8..32f0c461 100644 --- a/generic/hostname.h +++ b/generic/hostname.h @@ -9,6 +9,7 @@ in the source distribution for its full text. #include <stddef.h> + void Generic_hostname(char* buffer, size_t size); #endif diff --git a/generic/openzfs_sysctl.h b/generic/openzfs_sysctl.h index 4cf5485e..dab13051 100644 --- a/generic/openzfs_sysctl.h +++ b/generic/openzfs_sysctl.h @@ -9,6 +9,7 @@ in the source distribution for its full text. #include "zfs/ZfsArcStats.h" + void openzfs_sysctl_init(ZfsArcStats* stats); void openzfs_sysctl_updateArcStats(ZfsArcStats* stats); diff --git a/generic/uname.c b/generic/uname.c index 5b4fb2cf..ecde11e1 100644 --- a/generic/uname.c +++ b/generic/uname.c @@ -61,18 +61,19 @@ static void parseOSRelease(char* buffer, size_t bufferLen) { snprintf(buffer, bufferLen, "%s%s%s", name[0] ? name : "", name[0] && version[0] ? " " : "", version); } - + char* Generic_uname(void) { static char savedString[ /* uname structure fields - manpages recommend sizeof */ - sizeof(uname_info.sysname) + - sizeof(uname_info.release) + - sizeof(uname_info.machine) + + sizeof(((struct utsname*)0)->sysname) + + sizeof(((struct utsname*)0)->release) + + sizeof(((struct utsname*)0)->machine) + 16/*markup*/ + 128/*distro*/] = {'\0'}; static bool loaded_data = false; if (!loaded_data) { + struct utsname uname_info; int uname_result = uname(&uname_info); char distro[128]; |