Make error message meaningful if dlopen() fails on libX11.
authorRyan C. Gordon <icculus@icculus.org>
Fri, 13 Jan 2006 02:32:07 +0000
changeset 1246ca51a76a7328
parent 1245 fe7d081a4955
child 1247 ff73ee89ff4b
Make error message meaningful if dlopen() fails on libX11.
src/video/x11/SDL_x11gl.c
     1.1 --- a/src/video/x11/SDL_x11gl.c	Fri Jan 13 01:30:21 2006 +0000
     1.2 +++ b/src/video/x11/SDL_x11gl.c	Fri Jan 13 02:32:07 2006 +0000
     1.3 @@ -466,15 +466,19 @@
     1.4  			int dlopen_flags = RTLD_LAZY;
     1.5  		#endif
     1.6  		handle = dlopen(path, dlopen_flags);
     1.7 +		if ( handle == NULL ) {
     1.8 +			SDL_SetError("Could not load OpenGL library: %s", (const char *) dlerror());
     1.9 +			return -1;
    1.10 +		}
    1.11  	}
    1.12  	#else
    1.13  		handle = SDL_LoadObject(path);
    1.14 +		if ( handle == NULL ) {
    1.15 +			SDL_SetError("Could not load OpenGL library");
    1.16 +			return -1;
    1.17 +		}
    1.18  	#endif
    1.19  
    1.20 -	if ( handle == NULL ) {
    1.21 -		SDL_SetError("Could not load OpenGL library");
    1.22 -		return -1;
    1.23 -	}
    1.24  
    1.25  	/* Unload the old driver and reset the pointers */
    1.26  	X11_GL_UnloadLibrary(this);