diff options
author | Daniel Lange <DLange@git.local> | 2021-09-21 08:35:19 +0200 |
---|---|---|
committer | Daniel Lange <DLange@git.local> | 2021-09-21 08:35:19 +0200 |
commit | 69f439eff387a6ecb52734e400b297a3c85f2285 (patch) | |
tree | 2a988b7868b749654796183ba70b4272965da1bf /linux/SELinuxMeter.c | |
parent | c55320e9e2a8916e911bcd39ab37b79e3a7d03b2 (diff) | |
download | debian_htop-f24851b4db9bf65cb5b77d0666a12e569197bb72.tar.gz debian_htop-f24851b4db9bf65cb5b77d0666a12e569197bb72.tar.bz2 debian_htop-f24851b4db9bf65cb5b77d0666a12e569197bb72.zip |
New upstream version 3.1.0upstream/3.1.0
Diffstat (limited to 'linux/SELinuxMeter.c')
-rw-r--r-- | linux/SELinuxMeter.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/linux/SELinuxMeter.c b/linux/SELinuxMeter.c index 892f1e8..e3b076d 100644 --- a/linux/SELinuxMeter.c +++ b/linux/SELinuxMeter.c @@ -5,18 +5,17 @@ Released under the GNU GPLv2, see the COPYING file in the source distribution for its full text. */ -#include "SELinuxMeter.h" +#include "linux/SELinuxMeter.h" #include "CRT.h" #include <stdbool.h> +#include <stdint.h> #include <stdio.h> #include <unistd.h> -#include <linux/magic.h> #include <sys/statfs.h> #include <sys/statvfs.h> -#include "Macros.h" #include "Object.h" #include "XUtils.h" @@ -35,7 +34,7 @@ static bool hasSELinuxMount(void) { return false; } - if ((uint32_t)sfbuf.f_type != (uint32_t)SELINUX_MAGIC) { + if ((uint32_t)sfbuf.f_type != /* SELINUX_MAGIC */ 0xf97cff8cU) { return false; } @@ -70,11 +69,11 @@ static bool isSelinuxEnforcing(void) { return !!enforce; } -static void SELinuxMeter_updateValues(ATTR_UNUSED Meter* this, char* buffer, size_t len) { +static void SELinuxMeter_updateValues(Meter* this) { enabled = isSelinuxEnabled(); enforcing = isSelinuxEnforcing(); - xSnprintf(buffer, len, "%s%s", enabled ? "enabled" : "disabled", enabled ? (enforcing ? "; mode: enforcing" : "; mode: permissive") : ""); + xSnprintf(this->txtBuffer, sizeof(this->txtBuffer), "%s%s", enabled ? "enabled" : "disabled", enabled ? (enforcing ? "; mode: enforcing" : "; mode: permissive") : ""); } const MeterClass SELinuxMeter_class = { |