mirror of
https://github.com/Evolution-X/hardware_interfaces
synced 2026-02-01 11:36:00 +00:00
Log dlerror on dlopen related failures
Bug: 72300913 Bug: 72342986 Bug: 72462122 Test: manually confirmed logging on failure Change-Id: I401587311e5c3e3d1ef69516645ebb2dd4479c51
This commit is contained in:
@@ -12,7 +12,7 @@ cc_library_shared {
|
||||
],
|
||||
shared_libs: [
|
||||
"libdl",
|
||||
"liblog",
|
||||
"libbase",
|
||||
"libhidlbase",
|
||||
"libhidltransport",
|
||||
"libutils",
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
#define LOG_TAG "android.hardware.renderscript@1.0-impl"
|
||||
|
||||
#include "Context.h"
|
||||
#include "Device.h"
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#include "Context.h"
|
||||
#include "Device.h"
|
||||
|
||||
#include <android-base/logging.h>
|
||||
#include <android/dlext.h>
|
||||
#include <dlfcn.h>
|
||||
|
||||
@@ -54,12 +55,18 @@ dispatchTable loadHAL() {
|
||||
.flags = ANDROID_DLEXT_USE_NAMESPACE, .library_namespace = rsNamespace,
|
||||
};
|
||||
handle = android_dlopen_ext(filename, RTLD_LAZY | RTLD_LOCAL, &dlextinfo);
|
||||
if (handle == nullptr) {
|
||||
LOG(WARNING) << "android_dlopen_ext(" << filename << ") failed: " << dlerror();
|
||||
}
|
||||
}
|
||||
}
|
||||
if (handle == nullptr) {
|
||||
// if there is no "rs" namespace (in case when this HAL impl is loaded
|
||||
// into a vendor process), then use the plain dlopen.
|
||||
handle = dlopen(filename, RTLD_LAZY | RTLD_LOCAL);
|
||||
if (handle == nullptr) {
|
||||
LOG(FATAL) << "dlopen(" << filename << ") failed: " << dlerror();
|
||||
}
|
||||
}
|
||||
|
||||
dispatchTable dispatchHal = {
|
||||
|
||||
Reference in New Issue
Block a user