summaryrefslogtreecommitdiffstats
path: root/opengl/libs/EGL/Loader.cpp
diff options
context:
space:
mode:
authorMathias Agopian <mathias@google.com>2009-09-20 16:01:02 -0700
committerMathias Agopian <mathias@google.com>2009-09-20 16:07:26 -0700
commit8c17384a5edd027376926b857af1fb170dbe9b43 (patch)
tree5f995e7faabe9b2b0ee8c033a766d93c688cecd0 /opengl/libs/EGL/Loader.cpp
parent03268374fe506458e50b6c0ad6d333077883bb5e (diff)
downloadframeworks_native-8c17384a5edd027376926b857af1fb170dbe9b43.zip
frameworks_native-8c17384a5edd027376926b857af1fb170dbe9b43.tar.gz
frameworks_native-8c17384a5edd027376926b857af1fb170dbe9b43.tar.bz2
log an error when loading an existing GL driver fails
Diffstat (limited to 'opengl/libs/EGL/Loader.cpp')
-rw-r--r--opengl/libs/EGL/Loader.cpp19
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 =