Created
January 28, 2013 15:39
-
-
Save TZ86/4656533 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/udev/label.c b/src/udev/label.c | |
index d353da5..9a406d3 100644 | |
--- a/src/udev/label.c | |
+++ b/src/udev/label.c | |
@@ -31,11 +31,20 @@ | |
#include "path-util.h" | |
#ifdef HAVE_SELINUX | |
-#include "selinux-util.h" | |
+#include <stdbool.h> | |
#include <selinux/selinux.h> | |
#include <selinux/label.h> | |
static struct selabel_handle *label_hnd = NULL; | |
+static int use_selinux_cached = -1; | |
+ | |
+bool use_selinux(void) { | |
+ | |
+ if (use_selinux_cached < 0) | |
+ use_selinux_cached = is_selinux_enabled() > 0; | |
+ | |
+ return use_selinux_cached; | |
+} | |
#endif | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment