OSDN Git Service

Merge remote-tracking branch 'toybox/master' into HEAD am: 37852b74a7 am: 6e78ae7824
[android-x86/external-toybox.git] / lib / lsm.h
index aacabe0..e21d424 100644 (file)
--- a/lib/lsm.h
+++ b/lib/lsm.h
@@ -3,7 +3,7 @@
  * Copyright 2015 Rob Landley <rob@landley.net>
  */
 
-#ifndef BUILD_FOR_HOST
+#include <sys/xattr.h>
 
 #if CFG_TOYBOX_SELINUX
 #include <selinux/selinux.h>
 
 #if CFG_TOYBOX_SMACK
 #include <sys/smack.h>
-#include <sys/xattr.h>
 #include <linux/xattr.h>
 #else
+#ifndef XATTR_NAME_SMACK
 #define XATTR_NAME_SMACK 0
+#endif
 //ssize_t fgetxattr (int fd, char *name, void *value, size_t size);
 #define smack_smackfs_path(...) (-1)
 #define smack_new_label_from_self(...) (-1)
@@ -115,5 +116,3 @@ static inline int lsm_fget_context(int file, char **context)
     return smack_new_label_from_file(file, XATTR_NAME_SMACK, context);
   return fgetfilecon(file, context);
 }
-
-#endif // BUILD_FOR_HOST