From 8f4d5d592c66d873d5f21877131f4fe96a0f8203 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Wed, 13 Jun 2007 07:54:10 +0000 Subject: [PATCH] Date: Mon, 4 Jun 2007 06:17:59 +0000 (UTC) From: George Gensure Subject: [SDL] error removal patch for SDL_x11dyn.c I found that calling SDL_GetError when an error hasn't necessarily occurred is still reporting problems from loadso regarding dynamic functions in X11. I've added the following to my local copy to avoid revealing the 'many library lookup' approach adopted by x11dyn.c: --- src/video/x11/SDL_x11dyn.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/video/x11/SDL_x11dyn.c b/src/video/x11/SDL_x11dyn.c index a327c6ec8..c8f29213e 100644 --- a/src/video/x11/SDL_x11dyn.c +++ b/src/video/x11/SDL_x11dyn.c @@ -73,6 +73,11 @@ static void X11_GetSym(const char *fnname, int *rc, void **fn) } } + if (*fn != NULL) + SDL_ClearError(); + else + SDL_SetError("Failed to load function %s from x11libs", fnname); + #if DEBUG_DYNAMIC_X11 if (*fn != NULL) printf("X11: Found '%s' in %s (%p)\n", fnname, x11libs[i].libname, *fn);