Remove /dev/selinux directory creation from first_stage_init.cpp
Follow-up from aosp/2203897
Bug: 243923977
Test: m and manual verification
Change-Id: I9e41301d2fe4447906253a5c1249dc6c25cd5218
diff --git a/init/selinux.cpp b/init/selinux.cpp
index 6137988..ab5b0a0 100644
--- a/init/selinux.cpp
+++ b/init/selinux.cpp
@@ -525,7 +525,7 @@
"apex_service_contexts", "apex_seapp_contexts",
"apex_test"};
-Result<void> CreateTmpfsDirIfNeeded() {
+Result<void> CreateTmpfsDir() {
mode_t mode = 0744;
struct stat stat_data;
if (stat(kTmpfsDir.c_str(), &stat_data) != 0) {
@@ -539,6 +539,7 @@
if (!S_ISDIR(stat_data.st_mode)) {
return Error() << kTmpfsDir << " exists and is not a directory.";
}
+ LOG(WARNING) << "Directory " << kTmpfsDir << " already exists";
}
// Need to manually call chmod because mkdir will create a folder with
@@ -593,7 +594,7 @@
auto handle_guard = android::base::make_scope_guard([&handle] { CloseArchive(handle); });
- auto create = CreateTmpfsDirIfNeeded();
+ auto create = CreateTmpfsDir();
if (!create.ok()) {
return create.error();
}