Mesa (lp-binning): gallium/util: print dlerror() info upon dlopen() failure

Brian Paul brianp at kemper.freedesktop.org
Thu Jan 28 00:17:09 UTC 2010


Module: Mesa
Branch: lp-binning
Commit: 99f1e32fadbf16c167350af3304b2d68c464452a
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=99f1e32fadbf16c167350af3304b2d68c464452a

Author: Brian Paul <brianp at vmware.com>
Date:   Wed Jan 27 13:46:23 2010 -0700

gallium/util: print dlerror() info upon dlopen() failure

---

 src/gallium/auxiliary/util/u_dl.c |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/gallium/auxiliary/util/u_dl.c b/src/gallium/auxiliary/util/u_dl.c
index b42b429..d8803f7 100644
--- a/src/gallium/auxiliary/util/u_dl.c
+++ b/src/gallium/auxiliary/util/u_dl.c
@@ -26,8 +26,8 @@
  *
  **************************************************************************/
 
-
 #include "pipe/p_config.h"
+#include "util/u_debug.h"
 
 #if defined(PIPE_OS_UNIX)
 #include <dlfcn.h>
@@ -43,7 +43,12 @@ struct util_dl_library *
 util_dl_open(const char *filename)
 {
 #if defined(PIPE_OS_UNIX)
-   return (struct util_dl_library *)dlopen(filename, RTLD_LAZY | RTLD_GLOBAL);
+   struct util_dl_library *lib;
+   lib = (struct util_dl_library *)dlopen(filename, RTLD_LAZY | RTLD_GLOBAL);
+   if (!lib) {
+      debug_printf("gallium: dlopen() failed: %s\n", dlerror());
+   }
+   return lib;
 #elif defined(PIPE_OS_WINDOWS)
    return (struct util_dl_library *)LoadLibraryA(filename);
 #else




More information about the mesa-commit mailing list