diff options
Diffstat (limited to 'src/shared/smack-util.c')
-rw-r--r-- | src/shared/smack-util.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/shared/smack-util.c b/src/shared/smack-util.c index a73eaac6de..4e8cf796d3 100644 --- a/src/shared/smack-util.c +++ b/src/shared/smack-util.c @@ -21,16 +21,21 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ -#include "smack-util.h" - #include <unistd.h> -static int use_smack_cached = -1; +#include "smack-util.h" bool use_smack(void) { +#ifdef HAVE_SMACK + static int use_smack_cached = -1; + if (use_smack_cached < 0) - use_smack_cached = (access("/sys/fs/smackfs", F_OK) >= 0); + use_smack_cached = access("/sys/fs/smackfs/", F_OK) >= 0; return use_smack_cached; +#else + return false; +#endif + } |