diff options
author | Mathias Agopian <mathias@google.com> | 2009-09-20 16:01:02 -0700 |
---|---|---|
committer | Mathias Agopian <mathias@google.com> | 2009-09-20 16:07:26 -0700 |
commit | 40621774ec648c7d0089f66b4e3aeb94e4232769 (patch) | |
tree | 929189e75582bfc717120d25051dbda250def575 /opengl | |
parent | 0647b580aa7874311fc77b659e4f646750ddd74e (diff) | |
download | frameworks_base-40621774ec648c7d0089f66b4e3aeb94e4232769.zip frameworks_base-40621774ec648c7d0089f66b4e3aeb94e4232769.tar.gz frameworks_base-40621774ec648c7d0089f66b4e3aeb94e4232769.tar.bz2 |
log an error when loading an existing GL driver fails
Diffstat (limited to 'opengl')
-rw-r--r-- | opengl/libs/EGL/Loader.cpp | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/opengl/libs/EGL/Loader.cpp b/opengl/libs/EGL/Loader.cpp index d51b333..7e7da1b 100644 --- a/opengl/libs/EGL/Loader.cpp +++ b/opengl/libs/EGL/Loader.cpp @@ -222,19 +222,28 @@ void Loader::init_api(void* dso, } } -void *Loader::load_driver(const char* driver, gl_hooks_t* hooks, uint32_t mask) +void *Loader::load_driver(const char* driver_absolute_path, + gl_hooks_t* hooks, uint32_t mask) { - void* dso = dlopen(driver, RTLD_NOW | RTLD_LOCAL); - if (dso == 0) + if (access(driver_absolute_path, R_OK)) { + // this happens often, we don't want to log an error return 0; + } + + void* dso = dlopen(driver_absolute_path, RTLD_NOW | RTLD_LOCAL); + if (dso == 0) { + const char* err = dlerror(); + LOGE("load_driver(%s): %s", driver_absolute_path, err?err:"unknown"); + return 0; + } - LOGD("loaded %s", driver); + LOGD("loaded %s", driver_absolute_path); if (mask & EGL) { getProcAddress = (getProcAddressType)dlsym(dso, "eglGetProcAddress"); LOGE_IF(!getProcAddress, - "can't find eglGetProcAddress() in %s", driver); + "can't find eglGetProcAddress() in %s", driver_absolute_path); gl_hooks_t::egl_t* egl = &hooks->egl; __eglMustCastToProperFunctionPointerType* curr = |