chiark / gitweb /
core: expose a "Slice" property on Unit objects on the bus
[elogind.git] / src / core / smack-setup.c
index 73eeb041908d99915453d3452d20e2f9ed513b17..d67a84a583308362b80fe469e098b729c215206b 100644 (file)
@@ -42,6 +42,8 @@
 #define SMACK_CONFIG "/etc/smack/accesses.d/"
 #define CIPSO_CONFIG "/etc/smack/cipso/"
 
+#ifdef HAVE_SMACK
+
 static int write_rules(const char* dstpath, const char* srcdir) {
         _cleanup_fclose_ FILE *dst = NULL;
         _cleanup_closedir_ DIR *dir = NULL;
@@ -111,8 +113,12 @@ static int write_rules(const char* dstpath, const char* srcdir) {
        return r;
 }
 
+#endif
 
 int smack_setup(void) {
+
+#ifdef HAVE_SMACK
+
         int r;
 
         r = write_rules("/sys/fs/smackfs/load2", SMACK_CONFIG);
@@ -148,4 +154,8 @@ int smack_setup(void) {
                             strerror(abs(r)));
                 return 0;
         }
+
+#endif
+
+        return 0;
 }