summaryrefslogtreecommitdiffstats
path: root/libnativeloader
diff options
context:
space:
mode:
authorDimitry Ivanov <dimitry@google.com>2016-05-11 01:23:19 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2016-05-11 01:23:20 +0000
commit0756fae4f1aea5072ed820087b2487b408194c38 (patch)
tree2d2bc04190d65867b5fa897df68878f8c053d996 /libnativeloader
parent3fb5f1380671b6b9d3b511fc2b80051a14313dec (diff)
parent80ddb8f5517b4632307705858c3402081583a456 (diff)
downloadsystem_core-0756fae4f1aea5072ed820087b2487b408194c38.tar.gz
system_core-0756fae4f1aea5072ed820087b2487b408194c38.tar.bz2
system_core-0756fae4f1aea5072ed820087b2487b408194c38.zip
Merge "Check if public namespace has already been initialized"
Diffstat (limited to 'libnativeloader')
-rw-r--r--libnativeloader/native_loader.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/libnativeloader/native_loader.cpp b/libnativeloader/native_loader.cpp
index a2cbe1913..dca316c56 100644
--- a/libnativeloader/native_loader.cpp
+++ b/libnativeloader/native_loader.cpp
@@ -117,6 +117,13 @@ class LibraryNamespaces {
}
void Initialize() {
+ // Once public namespace is initialized there is no
+ // point in running this code - it will have no effect
+ // on the current list of public libraries.
+ if (initialized_) {
+ return;
+ }
+
std::vector<std::string> sonames;
const char* android_root_env = getenv("ANDROID_ROOT");
std::string root_dir = android_root_env != nullptr ? android_root_env : "/system";