X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fshared%2Fapparmor-util.c;h=c2bbd330bdd212051bbe5418d1f0ec7987b80a01;hb=4e658ebc585b051672a59b505cc788c12506d364;hp=2b85da1e4a2907557157d525bd1acc3feeef9f9b;hpb=d682b3a7e7c7c2941a4d3e193f1e330dbc9fae89;p=elogind.git
diff --git a/src/shared/apparmor-util.c b/src/shared/apparmor-util.c
index 2b85da1e4..c2bbd330b 100644
--- a/src/shared/apparmor-util.c
+++ b/src/shared/apparmor-util.c
@@ -19,23 +19,21 @@
along with systemd; If not, see .
***/
-#include
#include "util.h"
#include "fileio.h"
#include "apparmor-util.h"
-static int use_apparmor_cached = -1;
+bool mac_apparmor_use(void) {
+ static int cached_use = -1;
-bool use_apparmor(void) {
-
- if (use_apparmor_cached < 0) {
+ if (cached_use < 0) {
_cleanup_free_ char *p = NULL;
- use_apparmor_cached =
+ cached_use =
read_one_line_file("/sys/module/apparmor/parameters/enabled", &p) >= 0 &&
parse_boolean(p) > 0;
}
- return use_apparmor_cached;
+ return cached_use;
}