summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteven Moreland <smoreland@google.com>2021-02-18 21:21:35 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2021-02-18 21:21:35 +0000
commitce9eb8d9a25de5167e20f00a54cdcca297cf8688 (patch)
treef584b23a81b98d8f31369faeef3fee34381e4c7c
parentb21c955c969a4725bc5009257bffc8024fe33738 (diff)
parent0b3cd0401042f30b9b11a3d01377d764ffa627b4 (diff)
downloadlibhidl-ce9eb8d9a25de5167e20f00a54cdcca297cf8688.tar.gz
libhidlbase: avoid dlclose am: edd49128bc am: 6785dc4b99 am: a2680e6287 am: 0b3cd04010
Original change: https://android-review.googlesource.com/c/platform/system/libhidl/+/1592996 MUST ONLY BE SUBMITTED BY AUTOMERGER Change-Id: I2313d6582a8ef4e709adf051efc6dc43b8207f08
-rw-r--r--transport/ServiceManagement.cpp23
1 files changed, 16 insertions, 7 deletions
diff --git a/transport/ServiceManagement.cpp b/transport/ServiceManagement.cpp
index b51c600..c4e03c3 100644
--- a/transport/ServiceManagement.cpp
+++ b/transport/ServiceManagement.cpp
@@ -417,18 +417,27 @@ struct PassthroughServiceManager : IServiceManager1_1 {
*(void **)(&generator) = dlsym(handle, sym.c_str());
if(!generator) {
const char* error = dlerror();
- LOG(ERROR) << "Passthrough lookup opened " << lib
- << " but could not find symbol " << sym << ": "
- << (error == nullptr ? "unknown error" : error);
- dlclose(handle);
- return true;
+ LOG(ERROR) << "Passthrough lookup opened " << lib << " but could not find symbol "
+ << sym << ": " << (error == nullptr ? "unknown error" : error)
+ << ". Keeping library open.";
+
+ // dlclose too problematic in multi-threaded environment
+ // dlclose(handle);
+
+ return true; // continue
}
ret = (*generator)(name.c_str());
if (ret == nullptr) {
- dlclose(handle);
- return true; // this module doesn't provide this instance name
+ LOG(ERROR) << "Could not find instance '" << name.c_str() << "' in library " << lib
+ << ". Keeping library open.";
+
+ // dlclose too problematic in multi-threaded environment
+ // dlclose(handle);
+
+ // this module doesn't provide this particular instance
+ return true; // continue
}
// Actual fqname might be a subclass.