On Fri, Nov 14, 2014 at 1:31 PM, Aaron Watry <awa...@gmail.com> wrote: > On Fri, Nov 14, 2014 at 12:04 PM, Ilia Mirkin <imir...@alum.mit.edu> wrote: >> On Fri, Nov 14, 2014 at 12:48 PM, Aaron Watry <awa...@gmail.com> wrote: >>> Signed-off-by: Aaron Watry <awa...@gmail.com> >>> CC: Ilia Mirkin <imir...@alum.mit.edu> >>> >>> v4: Call dlerror() twice instead of freeing glibc's memory. >>> Prevents issues on C Libraries that don't malloc the error string. >>> v3: Switch comment to C-Style >>> v2: Use strdup instead of calloc/strcpy >>> --- >>> src/gallium/auxiliary/pipe-loader/pipe_loader.c | 6 ++++++ >>> 1 file changed, 6 insertions(+) >>> >>> diff --git a/src/gallium/auxiliary/pipe-loader/pipe_loader.c >>> b/src/gallium/auxiliary/pipe-loader/pipe_loader.c >>> index 8e79f85..f103497 100644 >>> --- a/src/gallium/auxiliary/pipe-loader/pipe_loader.c >>> +++ b/src/gallium/auxiliary/pipe-loader/pipe_loader.c >>> @@ -25,6 +25,8 @@ >>> * >>> >>> **************************************************************************/ >>> >>> +#include <dlfcn.h> >>> + >>> #include "pipe_loader_priv.h" >>> >>> #include "util/u_inlines.h" >>> @@ -101,6 +103,10 @@ pipe_loader_find_module(struct pipe_loader_device *dev, >>> if (lib) { >>> return lib; >>> } >>> + >>> + /* Retrieve the dlerror() str twice. Once to populate the error, >>> twice to clear it. */ >>> + dlerror(); >>> + dlerror(); >> >> Is this portable? Perhaps just if PIPE_OS_UNIX or something? (For the >> include as well...) >> >> I could be wrong on that though. But please check :) >> > > How about changing dlerror to util_dl_error? It takes care of the > os-portability issues.
Even better. _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev