From 7a1d8a10a8e40004034953a91ad314d1176e146f Mon Sep 17 00:00:00 2001 From: Justin Yun Date: Mon, 22 May 2017 14:31:56 +0900 Subject: [PATCH] libvndksupport: Do not lookup default namespace for sphal failure Instead of looking up default namespace for the failure of loading sphal libs, report failure. This is only for the devices that have sphal namespace. Bug: 38435840 Test: sailfish builds and boots Test: libvndksupport-tests passes Change-Id: Ibbff5f2d5d83f6482f98677a5492777db6416967 Merged-In: Ibbff5f2d5d83f6482f98677a5492777db6416967 (cherry picked from commit 17baed1012b6abd57e54caa902c0e28d9f0f087c) --- libvndksupport/linker.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/libvndksupport/linker.c b/libvndksupport/linker.c index 12aa3bec8..289f153e7 100644 --- a/libvndksupport/linker.c +++ b/libvndksupport/linker.c @@ -30,21 +30,17 @@ void* android_load_sphal_library(const char* name, int flag) { .flags = ANDROID_DLEXT_USE_NAMESPACE, .library_namespace = sphal_namespace, }; void* handle = android_dlopen_ext(name, flag, &dlextinfo); - if (handle) { - return handle; - } else { - ALOGW( - "Could not load %s from sphal namespace: %s. " - "Falling back to loading it from the current namespace,", - name, dlerror()); + if (!handle) { + ALOGE("Could not load %s from sphal namespace: %s.", name, dlerror()); } + return handle; } else { ALOGI( "sphal namespace is not configured for this process. " "Loading %s from the current namespace instead.", name); + return dlopen(name, flag); } - return dlopen(name, flag); } int android_unload_sphal_library(void* handle) { return dlclose(handle); }