summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNathan Scott <nathans@redhat.com>2021-03-04 09:00:34 +1100
committerNathan Scott <nathans@redhat.com>2021-03-04 13:44:40 +1100
commitadaf748ab6e779fdf53706448bb31718f098f6d5 (patch)
tree4de3ca3bcbc77be2cc9f9987b8bbcdf50cae1df8
parent61ef1134d97dbcf8b4ee069b36addf3c706ff55c (diff)
Fix include file ordering of generic headers
-rw-r--r--darwin/DarwinProcessList.c2
-rw-r--r--darwin/Platform.h4
-rw-r--r--dragonflybsd/Platform.h4
-rw-r--r--freebsd/FreeBSDProcessList.c2
-rw-r--r--freebsd/Platform.h4
-rw-r--r--generic/hostname.h1
-rw-r--r--generic/openzfs_sysctl.h1
-rw-r--r--generic/uname.c9
-rw-r--r--linux/Platform.h4
-rw-r--r--openbsd/Platform.h4
-rw-r--r--solaris/Platform.h4
11 files changed, 21 insertions, 18 deletions
diff --git a/darwin/DarwinProcessList.c b/darwin/DarwinProcessList.c
index c8f89e9b..8bb2651a 100644
--- a/darwin/DarwinProcessList.c
+++ b/darwin/DarwinProcessList.c
@@ -20,9 +20,9 @@ in the source distribution for its full text.
#include "CRT.h"
#include "DarwinProcess.h"
-#include "generic/openzfs_sysctl.h"
#include "Platform.h"
#include "ProcessList.h"
+#include "generic/openzfs_sysctl.h"
#include "zfs/ZfsArcStats.h"
diff --git a/darwin/Platform.h b/darwin/Platform.h
index c329c608..83a9b651 100644
--- a/darwin/Platform.h
+++ b/darwin/Platform.h
@@ -16,11 +16,11 @@ in the source distribution for its full text.
#include "CPUMeter.h"
#include "DarwinProcess.h"
#include "DiskIOMeter.h"
-#include "generic/hostname.h"
-#include "generic/uname.h"
#include "NetworkIOMeter.h"
#include "ProcessLocksScreen.h"
#include "SignalsPanel.h"
+#include "generic/hostname.h"
+#include "generic/uname.h"
extern const ProcessField Platform_defaultFields[];
diff --git a/dragonflybsd/Platform.h b/dragonflybsd/Platform.h
index 2ed97a70..4defaaf8 100644
--- a/dragonflybsd/Platform.h
+++ b/dragonflybsd/Platform.h
@@ -14,11 +14,11 @@ in the source distribution for its full text.
#include "Action.h"
#include "BatteryMeter.h"
#include "DiskIOMeter.h"
-#include "generic/hostname.h"
-#include "generic/uname.h"
#include "NetworkIOMeter.h"
#include "ProcessLocksScreen.h"
#include "SignalsPanel.h"
+#include "generic/hostname.h"
+#include "generic/uname.h"
extern const ProcessField Platform_defaultFields[];
diff --git a/freebsd/FreeBSDProcessList.c b/freebsd/FreeBSDProcessList.c
index 622403be..23f910f7 100644
--- a/freebsd/FreeBSDProcessList.c
+++ b/freebsd/FreeBSDProcessList.c
@@ -30,13 +30,13 @@ in the source distribution for its full text.
#include "CRT.h"
#include "Compat.h"
#include "FreeBSDProcess.h"
-#include "generic/openzfs_sysctl.h"
#include "Macros.h"
#include "Object.h"
#include "Process.h"
#include "ProcessList.h"
#include "Settings.h"
#include "XUtils.h"
+#include "generic/openzfs_sysctl.h"
#include "zfs/ZfsArcStats.h"
diff --git a/freebsd/Platform.h b/freebsd/Platform.h
index 79dfe0bd..ab5c63cf 100644
--- a/freebsd/Platform.h
+++ b/freebsd/Platform.h
@@ -13,13 +13,13 @@ in the source distribution for its full text.
#include "Action.h"
#include "BatteryMeter.h"
#include "DiskIOMeter.h"
-#include "generic/hostname.h"
-#include "generic/uname.h"
#include "Meter.h"
#include "NetworkIOMeter.h"
#include "Process.h"
#include "ProcessLocksScreen.h"
#include "SignalsPanel.h"
+#include "generic/hostname.h"
+#include "generic/uname.h"
extern const ProcessField Platform_defaultFields[];
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];
diff --git a/linux/Platform.h b/linux/Platform.h
index 2d528bd3..299d261a 100644
--- a/linux/Platform.h
+++ b/linux/Platform.h
@@ -14,13 +14,13 @@ in the source distribution for its full text.
#include "Action.h"
#include "BatteryMeter.h"
#include "DiskIOMeter.h"
-#include "generic/hostname.h"
-#include "generic/uname.h"
#include "Meter.h"
#include "NetworkIOMeter.h"
#include "Process.h"
#include "ProcessLocksScreen.h"
#include "SignalsPanel.h"
+#include "generic/hostname.h"
+#include "generic/uname.h"
/* GNU/Hurd does not have PATH_MAX in limits.h */
#ifndef PATH_MAX
diff --git a/openbsd/Platform.h b/openbsd/Platform.h
index 8d9791e1..bdd44a50 100644
--- a/openbsd/Platform.h
+++ b/openbsd/Platform.h
@@ -14,13 +14,13 @@ in the source distribution for its full text.
#include "Action.h"
#include "BatteryMeter.h"
#include "DiskIOMeter.h"
-#include "generic/hostname.h"
-#include "generic/uname.h"
#include "Meter.h"
#include "NetworkIOMeter.h"
#include "Process.h"
#include "ProcessLocksScreen.h"
#include "SignalsPanel.h"
+#include "generic/hostname.h"
+#include "generic/uname.h"
extern const ProcessField Platform_defaultFields[];
diff --git a/solaris/Platform.h b/solaris/Platform.h
index 4a6765a1..bacadf07 100644
--- a/solaris/Platform.h
+++ b/solaris/Platform.h
@@ -19,11 +19,11 @@ in the source distribution for its full text.
#include "Action.h"
#include "BatteryMeter.h"
#include "DiskIOMeter.h"
-#include "generic/hostname.h"
-#include "generic/uname.h"
#include "NetworkIOMeter.h"
#include "ProcessLocksScreen.h"
#include "SignalsPanel.h"
+#include "generic/hostname.h"
+#include "generic/uname.h"
#define kill(pid, signal) kill(pid / 1024, signal)

© 2014-2024 Faster IT GmbH | imprint | privacy policy