aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLiu Bolun <bolunx.liu@intel.com>2013-03-06 20:41:31 -0500
committerPatrick Tjin <pattjin@google.com>2014-07-21 22:03:41 -0700
commit992a01bf94ddc7b65e65f3eb2b444b4c2ff9c2f6 (patch)
tree513ef983494ee9cf5d0462e4bd30200a099ba50a
parentd438ab4e1c4dde0b5e0aa7c44186137b2d2adaa5 (diff)
downloadwrs_omxil_core-992a01bf94ddc7b65e65f3eb2b444b4c2ff9c2f6.tar.gz
OMXIL Core Checking return value of dlsym() to workaround Bionic issue
BZ: 91187 Change to use return value of dlsym() instead of dlerror() to check whether the result of dlsym() is successful or not. It can workaround the Bionic issue that might cause other issues. Signed-off-by: Liu Bolun <bolunx.liu@intel.com> Change-Id: I88dc45c523dabd77cb0598dbd0b66d38b2d4d0e4 Reviewed-on: http://android.intel.com:8080/95452 Reviewed-by: Liu, BolunX <bolunx.liu@intel.com> Reviewed-by: Yuan, Shengquan <shengquan.yuan@intel.com> Reviewed-by: Shi, PingX <pingx.shi@intel.com> Tested-by: Shi, PingX <pingx.shi@intel.com> Reviewed-by: buildbot <buildbot@intel.com> Tested-by: buildbot <buildbot@intel.com>
-rw-r--r--utils/src/module.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/utils/src/module.c b/utils/src/module.c
index 6adc5d4..d8a2c71 100644
--- a/utils/src/module.c
+++ b/utils/src/module.c
@@ -242,7 +242,7 @@ int module_close(struct module *module)
void *module_symbol(struct module *module, const char *string)
{
- void *symbol;
+ void *symbol = NULL;
const char *dlerr;
if (!module || !module->handle || !string)
@@ -250,10 +250,9 @@ void *module_symbol(struct module *module, const char *string)
pthread_mutex_lock(&g_lock);
- dlerror();
symbol = dlsym(module->handle, string);
- dlerr = dlerror();
- if (dlerr) {
+ if (!symbol) {
+ dlerr = dlerror();
LOGE("not founded symbol %s in module %s (%s)\n",
string, module->name, dlerr);
module_set_error(dlerr);