summaryrefslogtreecommitdiffstats
path: root/HostnameMeter.c
diff options
context:
space:
mode:
authorNathan Scott <nathans@redhat.com>2021-03-02 15:58:11 +1100
committerNathan Scott <nathans@redhat.com>2021-03-04 13:40:11 +1100
commit5b50ae3aa3a418f3f84ff2fdb172ab447753814f (patch)
tree17fcbba67e6935b2da236dc8dba4ee7fbfab4177 /HostnameMeter.c
parent2328e52403dfa52d122a9f7ccbd365beaedb8c9f (diff)
Separate display from sampling in SysArch and Hostname Meters
Several of our newer meters have merged coding concerns in terms of extracting values and displaying those values. This commit rectifies that for the SysArch and Hostname meters, allowing use of this code with alternative front/back ends. The SysArch code is also refined to detect whether the platform has an os-release file at all and/or the sys/utsname.h header via configure.ac.
Diffstat (limited to 'HostnameMeter.c')
-rw-r--r--HostnameMeter.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/HostnameMeter.c b/HostnameMeter.c
index af8e3493..924def11 100644
--- a/HostnameMeter.c
+++ b/HostnameMeter.c
@@ -8,6 +8,7 @@ in the source distribution for its full text.
#include "config.h" // IWYU pragma: keep
#include "HostnameMeter.h"
+#include "Platform.h"
#include <unistd.h>
@@ -19,9 +20,8 @@ static const int HostnameMeter_attributes[] = {
HOSTNAME
};
-static void HostnameMeter_updateValues(Meter* this, char* buffer, size_t size) {
- (void) this;
- gethostname(buffer, size - 1);
+static void HostnameMeter_updateValues(ATTR_UNUSED Meter* this, char* buffer, size_t size) {
+ Platform_getHostname(buffer, size);
}
const MeterClass HostnameMeter_class = {

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