summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorandroid-build-team Robot <android-build-team-robot@google.com>2017-06-01 07:15:06 +0000
committerandroid-build-team Robot <android-build-team-robot@google.com>2017-06-01 07:15:06 +0000
commitd5e1f8a543f8f7364e8c7a0ca7c74310ac35b945 (patch)
treeb3ae0c88c7c437c16d7d8b017a2b53909a2bcbab
parent9fac6e907f4ba1198eb73a06b1a7dcda5c3ee0f3 (diff)
parenta6ff1a46987a138fd611f25d15022eb06e2bdaaf (diff)
downloadlibhardware-d5e1f8a543f8f7364e8c7a0ca7c74310ac35b945.tar.gz
release-request-18270495-77c6-4d95-8968-eb22e3d2fe8b-for-git_oc-release-4057656 snap-temp-L93200000069424216
Change-Id: Ia550b92ea7680c3616a4e634832b0cc267eda6be
-rw-r--r--hardware.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/hardware.c b/hardware.c
index 37b61c44..8faac074 100644
--- a/hardware.c
+++ b/hardware.c
@@ -82,7 +82,14 @@ static int load(const char *id,
* dlopen returns. Since RTLD_GLOBAL is not or'd in with
* RTLD_NOW the external symbols will not be global
*/
- handle = android_load_sphal_library(path, RTLD_NOW);
+ if (strncmp(path, "/system/", 8) == 0) {
+ /* If the library is in system partition, no need to check
+ * sphal namespace. Open it with dlopen.
+ */
+ handle = dlopen(path, RTLD_NOW);
+ } else {
+ handle = android_load_sphal_library(path, RTLD_NOW);
+ }
if (handle == NULL) {
char const *err_str = dlerror();
ALOGE("load: module=%s\n%s", path, err_str?err_str:"unknown");