aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2024-04-25 01:24:33 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2024-04-25 01:24:33 +0000
commit521e557f5820b8f58faee9cca92530b1e8136ba0 (patch)
treeb1215e97f609004cf020b45b6abf9155a71d1370
parenta1fb2f1b6a6505083df57088ce4df1baad5d154f (diff)
parentb637e9b692c05e5c597c27efb93ed71290a8c381 (diff)
downloadbionic-521e557f5820b8f58faee9cca92530b1e8136ba0.tar.gz
Merge "Snap for 11762235 from 9c7892202fa03078d7dbce48143c8b758fa13f2b to sdk-release" into sdk-release
-rw-r--r--libc/system_properties/system_properties.cpp16
1 files changed, 10 insertions, 6 deletions
diff --git a/libc/system_properties/system_properties.cpp b/libc/system_properties/system_properties.cpp
index 9dd5e35ce..1dedb61e7 100644
--- a/libc/system_properties/system_properties.cpp
+++ b/libc/system_properties/system_properties.cpp
@@ -120,14 +120,18 @@ bool SystemProperties::AreaInit(const char* filename, bool* fsetxattr_failed,
return false;
}
- auto* appcompat_contexts = new (appcompat_override_contexts_data_) ContextsSerialized();
appcompat_filename_ = PropertiesFilename(properties_filename_.c_str(), "appcompat_override");
- if (!appcompat_contexts->Initialize(true, appcompat_filename_.c_str(), fsetxattr_failed,
- load_default_path)) {
- appcompat_override_contexts_ = nullptr;
- return false;
+ appcompat_override_contexts_ = nullptr;
+ if (access(appcompat_filename_.c_str(), F_OK) != -1) {
+ auto* appcompat_contexts = new (appcompat_override_contexts_data_) ContextsSerialized();
+ if (!appcompat_contexts->Initialize(true, appcompat_filename_.c_str(), fsetxattr_failed,
+ load_default_path)) {
+ // The appcompat folder exists, but initializing it failed
+ return false;
+ } else {
+ appcompat_override_contexts_ = appcompat_contexts;
+ }
}
- appcompat_override_contexts_ = appcompat_contexts;
initialized_ = true;
return true;