From a216fe3cc6d9d289b8c09fefe581965bbaf5c5fe Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Fri, 13 Jan 2006 02:32:07 +0000 Subject: [PATCH] Make error message meaningful if dlopen() fails on libX11. --HG-- extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401249 --- src/video/x11/SDL_x11gl.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/video/x11/SDL_x11gl.c b/src/video/x11/SDL_x11gl.c index fe7a4f4e1..c60f4ea09 100644 --- a/src/video/x11/SDL_x11gl.c +++ b/src/video/x11/SDL_x11gl.c @@ -466,15 +466,19 @@ int X11_GL_LoadLibrary(_THIS, const char* path) int dlopen_flags = RTLD_LAZY; #endif handle = dlopen(path, dlopen_flags); + if ( handle == NULL ) { + SDL_SetError("Could not load OpenGL library: %s", (const char *) dlerror()); + return -1; + } } #else handle = SDL_LoadObject(path); + if ( handle == NULL ) { + SDL_SetError("Could not load OpenGL library"); + return -1; + } #endif - if ( handle == NULL ) { - SDL_SetError("Could not load OpenGL library"); - return -1; - } /* Unload the old driver and reset the pointers */ X11_GL_UnloadLibrary(this);