Skip to content

Commit

Permalink
Make error message meaningful if dlopen() fails on libX11.
Browse files Browse the repository at this point in the history
  • Loading branch information
icculus committed Jan 13, 2006
1 parent 211ba1b commit bf72d6f
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/video/x11/SDL_x11gl.c
Expand Up @@ -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);
Expand Down

0 comments on commit bf72d6f

Please sign in to comment.