Commit d2302ca4 authored by Alice Chu's avatar Alice Chu
Browse files

Check mkdir return value before calling mount.

Change-Id: If058da4431215fa4b6f895563ba13620b7d9a81a
parent d10c3437
......@@ -682,7 +682,12 @@ int selinux_android_load_policy(void)
if (errno == ENOENT) {
/* Fall back to legacy mountpoint. */
mnt = OLDSELINUXMNT;
mkdir(mnt, 0755);
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);
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment