summaryrefslogtreecommitdiff
path: root/src/android.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/android.c')
-rw-r--r--src/android.c28
1 files changed, 1 insertions, 27 deletions
diff --git a/src/android.c b/src/android.c
index 0856ff9..4b2b0d6 100644
--- a/src/android.c
+++ b/src/android.c
@@ -1596,33 +1596,7 @@ int selinux_android_reload_policy(void)
int selinux_android_load_policy(void)
{
- const char *mnt = SELINUXMNT;
- int rc;
- rc = mount(SELINUXFS, mnt, SELINUXFS, 0, NULL);
- if (rc < 0) {
- if (errno == ENODEV) {
- /* SELinux not enabled in kernel */
- return -1;
- }
- if (errno == ENOENT) {
- /* Fall back to legacy mountpoint. */
- mnt = OLDSELINUXMNT;
- rc = mkdir(mnt, 0755);
- if (rc == -1 && errno != EEXIST) {
- selinux_log(SELINUX_ERROR,"SELinux: Could not mkdir: %s\n",
- strerror(errno));
- return -1;
- }
- rc = mount(SELINUXFS, mnt, SELINUXFS, 0, NULL);
- }
- }
- if (rc < 0) {
- selinux_log(SELINUX_ERROR,"SELinux: Could not mount selinuxfs: %s\n",
- strerror(errno));
- return -1;
- }
- set_selinuxmnt(mnt);
-
+ set_selinuxmnt(SELINUXMNT);
return selinux_android_load_policy_helper(false);
}